PP.MapImageMilestone(settings);
settings. The JSON object with the values of the component properties.
The MapImageMilestone constructor creates an instance of the MapImageMilestone class.
To execute the example the HTML page must contain the MapChart component (see Map Layout on HTML Page) named map, XML file that contains map settings and the Russia.svg topobase.
The XML file must include settings for the layer with the Regions identifier.
Create the addImageMilestone() function executing which adds a milestone with an image on the map. The function is added after the string: map.addToNode(document.getElementById("map-content")).
function addImageMilestone() {
var imageMilestoneSettings = {
//Full Setup of a Milestone with an Image
}
//define a map for the milestone
imageMilestoneSettings.Chart = map;
//create a milestone with an image
var imageMilestone = new PP.MapImageMilestone(imageMilestoneSettings);
//define layer for the milestone
map.getLayer("Regions").Milestones = imageMilestone;
//milestone rendering
map.getLayer("Regions").Milestones.draw(map.getScale());
}
//function is executed on loading the page
map.Loaded.add(addImageMilestone);
After executing the example, a milestone with an image is added on the map. Milestone appearance and position depend on the JSON settings.
See also: