dojox/geo/charting/Map (version 1.10)

Summary

Map widget interacted with charting.

Support rendering Americas, AsiaPacific, ContinentalEurope, EuropeMiddleEastAfrica, USStates, WorldCountries, and WorldCountriesMercator by default.

Usage

var foo = new Map(container,shapeData);
dojox/geo/charting/Map
Parameter Type Description
container Node

map container html node/id.

shapeData String | Object

map shape data json object, or url to json file.

See the dojox/geo/charting/Map reference documentation for more information.

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>

Property Summary

Method Summary

  • _addSeriesImpl(series)
  • _appendMarker(markerData)
  • _createAnimation(onShape,fromTransform,toTransform,onAnimationEnd) creates a transform animation object (between two transforms) used internally
  • _createZoomingCursor()
  • _getContainerBounds() returns the bounds {x:, y:, w: ,h:} of the DOM node container in absolute coordinates
  • _init(shapeData) inits this Map component.
  • _isMobileDevice() tests whether the application is running on a mobile device (android or iOS)
  • _queryDataStore()
  • addSeries(series) sets ranges of data values (associated with label, color) to style map data values
  • deselectAll() deselect all features of map
  • fitToMapArea(mapArea,pixelMargin,animate,onAnimationEnd) set this component's transformation so that the specified area fits in the component (centered)
  • fitToMapContents(pixelMargin,animate,onAnimationEnd) set this component's transformation so that the whole map data fits in the component (centered)
  • getMapCenter() returns the map coordinates of the center of this Map component.
  • getMapScale() returns the scale of this Map component.
  • mapCoordsToScreenCoords(mapX,mapY) converts map coordinates to screen coordinates given the current transform of this Map component
  • resize(adjustMapCenter,adjustMapScale,animate) resize the underlying GFX surface to accommodate to parent DOM Node size change
  • screenCoordsToMapCoords(screenX,screenY) converts screen coordinates to map coordinates given the current transform of this Map component
  • setDataBindingAttribute(prop) sets the property name of the dataStore items to use as value (see Feature.setValue function)
  • setDataBindingValueFunction(valueFunction) sets the function that extracts values from dataStore items,to use as Feature values (see Feature.setValue function)
  • setDataStore(dataStore,dataBindingProp) populate data for each map feature from fetched data store
  • setMapCenter(centerX,centerY,animate,onAnimationEnd) set this component's transformation so that the map is centered on the specified map coordinates
  • setMapCenterAndScale(centerX,centerY,scale,animate,onAnimationEnd) set this component's transformation so that the map is centered on the specified map coordinates and scaled to the specified scale.
  • setMapScale(scale,animate,onAnimationEnd) set this component's transformation so that the map is scaled to the specified scale.
  • setMapScaleAt(scale,fixedMapX,fixedMapY,animate,onAnimationEnd) set this component's transformation so that the map is scaled to the specified scale, and the specified point (in map coordinates) stays fixed on this Map component
  • setMarkerData(markerFile) import markers from outside file, associate with map feature by feature id which identified in map shape file, e.g: "NY":"New York"

Event Summary

  • _onDelete(item)
  • _onNew(newItem,parentItem)
  • _onSet(item,attribute,oldValue,newValue)
  • onFeatureClick(feature) Invoked when the specified feature is clicked.
  • onFeatureOver(feature) Invoked when the specified feature is hovered.
  • onZoomEnd(feature) Invoked when the specified feature has been zoomed.

Properties

_idAttributes
_onDeleteListener
_onNewListener
_onSetListener
colorAnimationDuration
dataBindingAttribute
dataBindingValueFunction
dataStore
defaultColor

Default map feature color, e.g: "#B7B7B7"

enableFeatureZoom
highlightColor

Map feature color when mouse over it, e.g: "#"

series

stack to data range, e.g: [{name:'label 1', min:20, max:70, color:'#DDDDDD'},{...},...]

showTooltips

Methods

_addSeriesImpl(series)
Parameter Type Description
series Object[]
_appendMarker(markerData)
Parameter Type Description
markerData undefined
_createAnimation(onShape,fromTransform,toTransform,onAnimationEnd)

creates a transform animation object (between two transforms) used internally

Parameter Type Description
onShape Object

The target shape.

fromTransform Object

the start transformation (when animation begins)

toTransform Object

the end transormation (when animation ends)

onAnimationEnd function

callback function to be executed when the animation completes.

Returns:undefined
_createZoomingCursor()
_getContainerBounds()

returns the bounds {x:, y:, w: ,h:} of the DOM node container in absolute coordinates

Returns:object
_init(shapeData)

inits this Map component.

Parameter Type Description
shapeData undefined
_isMobileDevice()

tests whether the application is running on a mobile device (android or iOS)

Returns:boolean
_queryDataStore()
addSeries(series)

sets ranges of data values (associated with label, color) to style map data values

Parameter Type Description
series url | Object[]

Either an url or an array of range objects such as : [{name:'label 1', min:20, max:70, color:'#DDDDDD'},{...},...]

deselectAll()

deselect all features of map

fitToMapArea(mapArea,pixelMargin,animate,onAnimationEnd)

set this component's transformation so that the specified area fits in the component (centered)

Parameter Type Description
mapArea Object

the map area that needs to fill the component expressed as {x,y,w,h}

pixelMargin int

a margin (in pixels) from the borders of the Map component.

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

fitToMapContents(pixelMargin,animate,onAnimationEnd)

set this component's transformation so that the whole map data fits in the component (centered)

Parameter Type Description
pixelMargin int

a margin (in pixels) from the borders of the Map component.

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

getMapCenter()

returns the map coordinates of the center of this Map component.

Returns:point | undefined

the center in map coordinates

getMapScale()

returns the scale of this Map component.

Returns:float | number

the scale

mapCoordsToScreenCoords(mapX,mapY)

converts map coordinates to screen coordinates given the current transform of this Map component

Parameter Type Description
mapX Number

the x coordinate of the point to convert.

mapY Number

the y coordinate of the point to convert.

Returns:any | undefined

{x:,y:} the screen coordinates corresponding to the specified map coordinates.

resize(adjustMapCenter,adjustMapScale,animate)

resize the underlying GFX surface to accommodate to parent DOM Node size change

Parameter Type Description
adjustMapCenter boolean

keeps the center of the map when resizing the surface

adjustMapScale boolean

adjusts the map scale to keep the visible portion of the map as much as possible

animate boolean*
screenCoordsToMapCoords(screenX,screenY)

converts screen coordinates to map coordinates given the current transform of this Map component

Parameter Type Description
screenX Number

the x coordinate of the point to convert.

screenY Number

the y coordinate of the point to convert.

Returns:any | undefined

the map coordinates corresponding to the specified screen coordinates.

setDataBindingAttribute(prop)

sets the property name of the dataStore items to use as value (see Feature.setValue function)

Parameter Type Description
prop String

the property

setDataBindingValueFunction(valueFunction)

sets the function that extracts values from dataStore items,to use as Feature values (see Feature.setValue function)

Parameter Type Description
valueFunction function

the function

setDataStore(dataStore,dataBindingProp)

populate data for each map feature from fetched data store

Parameter Type Description
dataStore dojo/data/ItemFileReadStore

the dataStore to fetch the information from

dataBindingProp String

sets the property name of the dataStore items to use as value

setMapCenter(centerX,centerY,animate,onAnimationEnd)

set this component's transformation so that the map is centered on the specified map coordinates

Parameter Type Description
centerX float

the X coordinate (in map coordinates) of the new center

centerY float

the Y coordinate (in map coordinates) of the new center

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

setMapCenterAndScale(centerX,centerY,scale,animate,onAnimationEnd)

set this component's transformation so that the map is centered on the specified map coordinates and scaled to the specified scale.

Parameter Type Description
centerX float

the X coordinate (in map coordinates) of the new center

centerY float

the Y coordinate (in map coordinates) of the new center

scale float

the scale of the map

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

setMapScale(scale,animate,onAnimationEnd)

set this component's transformation so that the map is scaled to the specified scale.

Parameter Type Description
scale Number

the scale ratio.

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

setMapScaleAt(scale,fixedMapX,fixedMapY,animate,onAnimationEnd)

set this component's transformation so that the map is scaled to the specified scale, and the specified point (in map coordinates) stays fixed on this Map component

Parameter Type Description
scale Number

the scale ratio.

fixedMapX float

the X coordinate (in map coordinates) of the fixed screen point

fixedMapY float

the Y coordinate (in map coordinates) of the fixed screen point

animate boolean

true if the transform change should be animated

onAnimationEnd function

a callback function to be executed when the animation completes (if animate set to true).

setMarkerData(markerFile)

import markers from outside file, associate with map feature by feature id which identified in map shape file, e.g: "NY":"New York"

Parameter Type Description
markerFile String

outside marker data url, handled as json style. data format: {"NY":"New York",.....}

Events

_onDelete(item)
Parameter Type Description
item undefined

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
_onNew(newItem,parentItem)
Parameter Type Description
newItem undefined
parentItem undefined

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
_onSet(item,attribute,oldValue,newValue)
Parameter Type Description
item undefined
attribute undefined
oldValue undefined
newValue undefined

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
onFeatureClick(feature)

Invoked when the specified feature is clicked.

Parameter Type Description
feature dojox/geo/charting/Feature

A Feature.

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
onFeatureOver(feature)

Invoked when the specified feature is hovered.

Parameter Type Description
feature dojox/geo/charting/Feature

A Feature.

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
onZoomEnd(feature)

Invoked when the specified feature has been zoomed.

Parameter Type Description
feature dojox/geo/charting/Feature

A Feature.

Examples

Example 1

var usaMap = new dojox.geo.charting.Map(srcNode, "dojotoolkit/dojox/geo/charting/resources/data/USStates.json");
<div id="map" style="width:600px;height:400px;"></div>
Error in the documentation? Can’t find what you are looking for? Let us know!