A control that enables users to add points to a map by clicking the map, and
then clicking those points to remove them. Like the boxselector control, it
calls a callback with the current map data, and also exposes an API,
addLocation(com.modestmaps.Location)
, if you wish to add points on pageload.
<div id='map-div'></div>
<script>
var mm = com.modestmaps;
wax.tilejson(
'http://tiles.mapbox.com/mapbox/api/Tileset/blue-marble-topo-bathy-jul',
function(tilejson) {
var m = new mm.Map('map-div',
new wax.mm.connector(tilejson))
wax.mm.pointselector(m, tilejson, {
callback: function(coords) {
$('#pointselector-text').text(coords.join(' - '));
}
});
m.setCenterZoom(new mm.Location(39, -98), 2);
}
);
</script>
var pointselector = wax.mm.pointselector(map, tilejson, options)
coords, containing a list of coordinates of
points that you've selected.
pointselector.addLocation(com.modestmaps.Location)
pointselector.deletePoint(location)