Creating a map
A map requires simple creating using F1.Maker.Map and a number of options. These options specify loading a saved map, where to put the map into the HTML page, and other options such as user interface controls, basemap and function callbacks.
var mymap = new F1.Maker.Map(options)
Required Arguments:
| Argument | Description | Example |
|---|---|---|
| map_id | integer ID number of the map to load on the embed | map_id: “42698″ |
| dom_id | string name of the DOM element to place the map. Must have it’s height set in pixels | dom_id: “sample_map” |
Optional Arguments:
| Argument | Description | Example |
|---|---|---|
| uiZoom | show the Zoom controls (default: true) | uiZoom: false |
| uiLayers | show the Layer controls (default: true) | uiLayers: false |
| uiStyles | show the Styles controls (default: true) | uiStyles: false |
| uiLegend | show the Legends controls (default: true) | uiLegend: false |
| uiHeader | show the Header title and controls – only visible in “Edit” mode (default: true) | uiHeader: false |
| mapProvider | String – name of the basemap provider (e.g. “Yahoo Road”, “OpenStreetMap (Road)”, “Google Hybrid”) | mapProvider: “Yahoo Road” |
| zoomLevel | Integer – zoom level to view the map (default: loaded map or 1) | zoomLevel: 5 |
| f1_session | String – optional session key for authenticated requests | see authenticatin below |
| f1_auth | String – optional authentication key for authenticated requests | see authentication below |
| callbacks | a javascript callback method. See Callback options below for more information | |
Example:
var mymap = new F1.Maker.Map({
map_id: 81930,
dom_id: "geocommons_map",
uiZoom: true,
uiLayers: true,
uiLegend: false
});
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
