Add Layer with Visual Filters
Add Layer:
Add Glow Filter:
Drop Shadow Filter:
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.net/locationboxus/services?
Key=key&Cmd=APIV2&Typ=JS"></script>
<script language="JavaScript">
var mapper = new IMapper();
function startup() {
mapper.initMap(40.7, 29.1, 7);
mapper.addNavigationPanel();
return;
}
function add() {
var colorStyle = mapper.createColorStyle("layerColor", "#FF3333", null, "#FFFFFF" , 0.2);
layer.createVectorLayer("ILLER", "iller",null,colorStyle,true, null,null,null,null);
return;
}
function setGlowFX() {
var glowFilter = mapper.createGrowStyle(null, "#00ff00", null, null);
layer.setVisualFilter("iller",glowFilter);
}
function setDropShadowFX()
{
var shadowFilter = mapper.createDropShadowStyle(0.9, "#77550e", 12, 1);
layer.setVisualFilter("iller",shadowFilter);
}
function remove() {
layer.removeLayer();
return;
}
</script>
Buttons:
<a href="javascript:add()"
><img src="images/add.gif" border=0></a>
<a href="javascript:setGlowFX()"
><img src="images/add.gif" border=0></a>
<a href="javascript:setDropShadowFX()"
><img src="images/add.gif" border=0></a>
<a href="javascript:remove()"
><img src="images/remove.gif" border=0></a>
Download working pageRemember that you need to use your key code as Key attribute.