Edited this code to show map and draggable marker on it
<script type='text/javascript'>
jsMaps.loader(function (){
var tiles = new jsMaps.Native.Tiles();
tiles.addTileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png",['a','b','c'],'','');
var map = jsMaps.api.init(
'#map',
'native',
{
center: {
latitude: <?php echo $lat;?>,
longitude: <?php echo $lon;?>
},
zoom: 17,
mouse_scroll: true,
zoom_control: true,
map_type: true
},tiles
);
var marker1 = jsMaps.api.marker(map,{position: {lat: <?php echo $lat;?>,lng: <?php echo $lon;?>}, title: 'Marker No 1',draggable: true});
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Drag to set good position</h1>'+
'<div id="bodyContent">'+
'<p>MyEasyMenu.cloud</p>'+
'</div>'+
'</div>';
var infoWindow = jsMaps.api.infoWindow({content: contentString});
jsMaps.api.attach_event(marker1,'mouseover',function() {
infoWindow.open(map,marker1);
});
jsMaps.api.attach_event(marker1,'mouseout',function() {
infoWindow.close();
});
jsMaps.api.attach_event(marker1,'dragend',function() {
//var lngLat = jsMaps.api.marker(map,{position{getPosition()});
document.getElementById("longitude").value = lngLat.lon;
document.getElementById("latitude").value = lngLat.lat;
});
});
</script>
I need to retrieve the coordinate from draggable marker. How can update the lat/lon after dragend ? on API resource mentioned Method but I don't know how to update the var lngLat.