| Markers XML structure | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
As you've already seen in the previous example, the XML data document containing markers for the map looks as under: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<map animation='0' showLabels='0' showMarkerLabels='1' fillColor='F1f1f1' borderColor='CCCCCC' baseFont='Verdana' baseFontSize='11' baseFontColor='333333' markerBorderColor='333333' markerBgColor='CCCCFF' markerRadius='7' legendPosition='bottom' useHoverColor='0' showToolTip='0' showMarkerToolTip='1' >
<data>
<entity id='NA' />
<entity id='SA' />
<entity id='EU' />
<entity id='AS' />
<entity id='AF' />
<entity id='AU' />
</data>
<markers>
<definition>
<marker id='HO' x='140.09' y='165.19' label='Head Office' />
<marker id='PF' x='533.37' y='182.25' label='Production Center' />
<marker id='SA' x='447.04' y='106.57' label='Sales' />
</definition>
<application>
<marker id='HO' shapeId='circle' />
<marker id='PF' shapeId='arc' />
<marker id='SA' shapeId='triangle' />
</application>
</markers>
</map> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
All data pertinent to markers are defined within the <markers> element under <map> element. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Attributes for <map> element pertinent to markers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You can define the following attributes for <map> element that will help you control the markers: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Marker Definition | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To define a marker, you need to create <marker> element under <definition> element. Note that just defining a marker does NOT show it on the map. Defining a marker is like creating a list of markers for the map, from which you can selectively choose and later show (in <application> element). Each <marker> element under <definition> element can have the following attributes:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Marker Application | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To show a marker on the map, you need to place a <marker> element under <application> element and match the proper ID from marker definitions. For example, in our office location demo, we first define the markers with unique IDs under <definition> element. Thereafter, we use the same ID from definition to apply markers. You need to make sure that in <application>, you use only those marker IDs, which have previously been defined in <definition>. Each <marker> element under <application> element can have the following attributes:
To make your lives easier, we've created marker definitions for important cities in the most of the maps and provided them as XML/JSON to you. You can re-use the definitions from those XML/JSON files present in Download Package > MarkerData folder. That covers all the properties for the definition and application of markers, barring custom shapes. Let's see custom shapes next. |