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:

ArgumentDescriptionExample
map_idinteger ID number of the map to load on the embedmap_id: “42698″
dom_idstring name of the DOM element to place the map. Must have it’s height set in pixelsdom_id: “sample_map”

Optional Arguments:

ArgumentDescriptionExample
uiZoomshow the Zoom controls (default: true)uiZoom: false
uiLayersshow the Layer controls (default: true)uiLayers: false
uiStylesshow the Styles controls (default: true)uiStyles: false
uiLegendshow the Legends controls (default: true)uiLegend: false
uiHeadershow the Header title and controls – only visible in “Edit” mode (default: true)uiHeader: false
mapProviderString – name of the basemap provider (e.g. “Yahoo Road”, “OpenStreetMap (Road)”, “Google Hybrid”)mapProvider: “Yahoo Road”
zoomLevelInteger – zoom level to view the map (default: loaded map or 1)zoomLevel: 5
f1_sessionString – optional session key for authenticated requestssee authenticatin below
f1_authString – optional authentication key for authenticated requestssee authentication below
callbacksa 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
  	});
 

Comments are closed.