Demo

LocationBox JavaScript Demos

Add Draggable Marker

Add:     Remove:  

Instructions

Use the "Add" button to add marker to a particular point on the map. Use "Remove" button to remove the marker. Edit the source code to add more markers to any other point.
See the JavaScript API for more information.

Source Code

The Javascript code for the above map is:

<script language="Javascript" 
	src="http://www.locationbox.com.tr/locationbox/services?
	Key=key&Cmd=APIV2&Typ=JS"></script>

<script language="JavaScript">
var mapper  = new IMapper();

function startup() {
  mapper.initMap(41.1, 29.1, 16);
  mapper.addNavigationPanel();
  mapper.addMarker('id_1', 40.97, 29.065, 'SampleMarker', 'M.PIN_1', 70, 70);
  
  markerStyle = mapper.createIconMarkerStyle("testMStyle", "images/MapMarker_Ball__Blue.png" , 32, 64);
  textStyle = mapper.createTextStyle("testTStyle", null, null, null, 16);
  labelStyle = mapper.createTextStyle("testLStyle", "#ffffff");
} 

function add() {
  mapper.addMapMarker("map_marker", 41.1, 29.1, markerStyle, "Custom Point", labelStyle, textStyle, true);
  return;
} 

function remove() {
  mapper.removeFeature('map_marker');
  return;
}
    
</script>
					

Buttons:


  <a href="javascript:add()"><img src="images/add.gif" border=0></a>
  <a href="javascript:remove()"><img src="images/remove.gif" border=0></a>
  
					
Download working page
Remember that you need to use your key code as Key attribute.

Notes

You can download our pin list.