JavaScript API
GeoIQ supports a developer friendly JavaScript API for integrating data and visualizations into web pages and applications. If you want to walk through the examples go to http://sandbox.geoiq.com/walk_through.html with Firefox and you can paste the examples into the console.
Includes
To begin using the GeoIQ JavaScript, you must first include the API library. If you are developing using the public GeoCommons community, you would include the API from the GeoCommons server:
However, if you are developing on a different GeoIQ server then you should include the library from the server that you are developing with. This is because the server will be searched based on where the library is loaded. Alternatively, you can set F1.host to the server you are developing with. For example:
<script type="text/javascript" charset="utf-8">
F1.host = “http://demo.geoiq.com”;
var geoiq_map = new F1.Maker.Map({map_id: "78378", dom_id: "map_div"});
</script>
Embed map
Usually the easiest way to get started with the GeoIQ JavaScript API is to first embed a map. You can then easily expand your integration from there. The example below
<div id="map_div"></div>
<script type="text/javascript" charset="utf-8" src="http://geocommons.com/javascripts/f1.api.js"></script>
<script type="text/javascript" charset="utf-8">
var geoiq_map = new F1.Maker.Map({map_id: "78378", dom_id: "map_div"});
</script>
Learn more
GeoIQ Blog- TechCamp April 30, 2012 Andrew Turner
- Visualizing our Changing Climate with Climascope April 27, 2012 Andrew Turner
- World Bank Annual Meetings April 23, 2012 Andrew Turner
- Just in Time Analytics – Kanban for Big Data April 5, 2012 Sean Gorman
- GeoIQ team at Where2.0, JSConf, FOSS4G-NA March 22, 2012 Andrew Turner
