TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mari muthu
NA
198
108k
How to Mark the Current Location in Google map
Jul 11 2016 1:12 AM
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 <br />Lat : " + position.coords.latitude + " </br>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
Reply
Answers (
2
)
Bind data and display datatable on aspx page using Jquery in
Using jQuery to get multiple checkbox's value and Multiple D