Add Marker with Info
Instructions
Use the "Add" button to add marker with info. Click the marker to get coordinates of point and marker id.
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(40.97, 29.065, 8);
mapper.addNavigationPanel();
return;
}
function mClick(mrk) {
alert("ID: " + mrk.id + ", X: " + mrk.x + ", Y: " + mrk.y);
return;
}
function add() {
mapper.addMarker('id_1', 40.97, 29.065, 'SampleMarker', 'M.PIN_1', 40, 40, mClick);
return;
}
function remove() {
mapper.removeFeature('id_1');
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 pageRemember that you need to use your key code as Key attribute.
Notes
You can download our pin list.