Demo

LocationBox JavaScript Demos

Scale Bar

Add Scale Bar:  

Instructions

Use the "Add Scale Bar" button to add a scale bar to the map.
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, 6);
    mapper.addNavigationPanel();
    return;
  }
  function addScaleBar() {
    mapper.addScaleBar("BOTH",3,15,"#rrggbb",15,"#cccccc","1px 1px 5px #000000",100);
    return;
  } 
  </script>
					

Buttons:

    <a href="javascript:addScaleBar()"><img src="images/add.gif" border=0></a>

					
Download working page
Remember that you need to use your key code as Key attribute.