Demo

LocationBox JavaScript Demos

Add Custom 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. Create a custom marker using any image.
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, 2);
    mapper.addNavigationPanel();
    return;
  }

  function add() {
    mapper.addCustomMarker('id_1', 41.1, 29.1, 'SampleMarker 1', 'images/small_circle.png', null);
    mapper.addCustomMarker('id_2', 41.15, 29.1, 'SampleMarker 2', 'images/baseball.gif', null);
    return;
  } 

  function remove() {
    mapper.removeFeature('id_1');
    mapper.removeFeature('id_2');
    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.