Flag Markers

This example demonstrates use of viewer flag markers.
Follow the six steps and learn how to use the FlagMarker object and its methods.


All of the code used in the 6 steps:

// create marker
marker = new giscloud.FlagMarker(
    new giscloud.LonLat(2300000, 6200000),
    "London",
    "London, UK... ,
    new giscloud.Color(255, 150, 0)
);

// add marker to viewer
viewer.addMarker(marker);

// change color
marker.color(
    new giscloud.Color(0, 40, 200)
);

// toggle marker visibility
marker.visible(
    !marker.visible()
);

// change marker position
marker.position(
    new giscloud.LonLat(-8226405, 4966405)
);

// change marker title
marker.title("New York");

// change marker content
marker.content(
    "New York, USA<br/>New York <a target='_blank' " +
	"href='http://en.wikipedia.org/wiki/New_York_City'>Wikipedia article</a>."
);

// remove the marker
viewer.removeMarker(marker);