Demo

LocationBox JavaScript Demos

Add Layer With Features Style

Add Layer:     Remove:  

Instructions

Use the "Add" button to add animated coloring layer on the map. Use "Remove" button to remove the layer. 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();
   var layer = new ILayer();
   var color01 = null;
   var color02 = null;
  
  function startup() {
    mapper.initMap(41.1, 29.1, 6);
    mapper.addNavigationPanel(); 
    return;
  } 
  
  function add() {
    color01 = new OM.style.Color({fill:"#0004FF",strokeThickness:5, stroke:"#0004FF"});
    color02 = new OM.style.Color({fill:"#ffff00",strokeThickness:5, stroke:"#ffff00"});
    acStyle = mapper.createAnimationColorStyle(color01, color02, 5, false);
    layer.createVectorLayer(ILayer.MAP_IL, "iller", "IL_ID = 34","IL_ID",acStyle,true, null,null,null);	
    return;
  } 
  
  function remove() {    
    layer.removeLayer();
    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.