var gmarkers = [];
var map;
for (i = 0; i < gmarkers.length; i++) {
gmarkers[i].setMap(null);
}
function initialize() {
if ("geolocation" in navigator) { //check geolocation available
//try to get user current location using getCurrentPosition() method
navigator.geolocation.getCurrentPosition(function (position) {
$("#result").html("Found your location
Lat : " + position.coords.latitude + " Lang :" + position.coords.longitude);
Lat : " + position.coords.latitude + " Lang :" + position.coords.longitude);
});
} else {
console.log("Browser doesn't support geolocation!");
}
var mapProp = {
center: new google.maps.LatLng(20.593684, 78.96288), //India Lat and Lon
zoom: 5,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var marker = new google.maps.Marker({
position: mapProp.center,
icon: "~/pinkball.png",
map: map
});
gmarkers.push(marker);
map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
hi friends this my code i already get my current location but in that location i want to mark by using one image .i didn't get that result mark is not showned inside the map please help me for this any one known this please share me help me

kalu singh raoRank #884 · 2.4K reputationPosted Jul 10, 2016, 10:07 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Jul 11, 2016, 12:16 AM EDT
Lat : " + position.coords.latitude + " Lang :" + position.coords.longitude);