Demo

LocationBox JavaScript Demos

Layer Demography

Population:   Vehicle Types :   Residence:   Age Groups:   Education:   Remove Layers:  

Instructions

Use the "Add" buttons to add layers by brand on the map. Use "Remove" button to remove the layers. Edit the source code to .
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=API&Typ=JS"></script>

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

var layer = new ILayer();
var layer1 = new ILayer();
var layer2 = new ILayer();
var layer3 = new ILayer();
var layer4 = new ILayer();


function startup() {
  mapper.initMap(41.1, 29.1, 10);
  mapper.addNavigationPanel();
  return;
} 

function add() {
  layer.createDemographicLayer("NUFUS", "nufusdemography", true, null);
  return;
} // add()

function add12() {
  layer1.createDemographicLayer("ARAC_SAYISI", "aracsayisidemography", true, null);
  return;
} // add12()

function add13() {
  layer2.createDemographicLayer("KONUT_SAYISI", "konutsayisidemography", true, null);
  return;
} // add13()

function add2() {
  layer3.createDemographicLayer("YAS_DURUMU", "yasdurumudemography", true, null);
  return;
} // add2()
  
function add21() {
  layer4.createDemographicLayer("EGITIM", "egitimdemography", true, null);
} // add21()
  
  
function remove() {
  layer.removeLayer();
  layer1.removeLayer();
  layer2.removeLayer();
  layer3.removeLayer();
  layer4.removeLayer();
  return;
} // remove()
  
        

Buttons:

  <a href="javascript:add()"><img src="images/add.gif" border=0></a>
  <a href="javascript:add12()"><img src="images/add.gif" border=0></a>
  <a href="javascript:add13()"><img src="images/add.gif" border=0></a>
  <a href="javascript:add2()"><img src="images/add.gif" border=0></a>
  <a href="javascript:remove()"><img src="images/remove.gif" border=0></a>
        
Notes

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