MapPolygonMilestone Constructor

Syntax

PP.MapImageMilestone(settings);

Parameters

settings. The JSON object with the values of the component properties.

Description

The MapImageMilestone constructor creates an instance of the MapImageMilestone class.

Example

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 addPolygonMilestone() function executing which adds a polygon-shaped milestone to the map. The function is added after the string: map.addToNode(document.getElementById("map-content")).

        function addPolygonMilestone() {

        var polygonMilestoneSettings = {

        //full component setup

           }

        //select a map for the milestone

        polygonMilestoneSettings.Chart = map;

        //create a polygon-shaped milestone

        var polygonMilestone = new PP.MapImageMilestone(polygonMilestoneSettings);

        //select a layer for the milestone

        map.getLayer("Regions").Milestones = polygonMilestone;

        //draw the milestone

         map.getLayer("Regions").Milestones.draw(map.getScale());

        }

        //the function runs on loading the page

        map.Loaded.add(addPolygonMilestone);

After executing the example a polygon-shaped milestone appears in the map. Milestone view and position depend on the JSON settings.

See also:

MapPolygonMilestone