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:
- id - ID that matches the marker application to its definition. If you specify an ID which has not been defined previously, you'll see an error in the debug window.
- shapeId - Using this attribute, you can set the shape that this marker will assume on the map. FusionMaps offers 4 default shapes - circle, arc, triangle or diamond. You can also define your custom shapes and then refer to those (as explained in next section).
- label - You can over-ride the labels for each marker during its application. This label will over-ride the label specified during definition.
- labelPos - Like label, you can also over-ride the label position for each marker during its application.
- toolText - If you need to provide custom tool text for a marker, you can do so using this attribute.
- link - If you need your marker to link to other pages, when clicked, define the link here. The link can open in same window, new window, pop-up, frames or as JavaScript functions etc. Please see "Drill Down Maps" section for more information on link format.
- scale - If you're using the same shape (shapeId) to represent multiple markers on the map, you can have them differ in size using this attribute. This attributes set the scaling of a particular marker. Valid values are floating numbers between 0 and 5.
To make your lives easier, we've created marker definitions for important cities in the most of the maps and provided them as XML to you. You can re-use the definitions from those XML files present in Download Package > MarkerXML folder.
That covers all the properties for the definition and application of markers, barring custom shapes. Let's see custom shapes next. |