Код работает нормально, но я хочу добавить свое местоположение.например, в приведенном ниже скрипте
map.setCenter (new google.maps.LatLng (37.4419, -122.1419), 13);
дает мне карту для этого перкулярного местоположения, если я хочу Pune,Тогда карта Индии, где мне нужно поместить это местоположение или как я могу получить координаты этого места?
как я могу это сделать, пожалуйста, помогите мне, я новичок в MVC.
<script type="text/javascript" src="http://www.google.com/jsapi?key=mykey"></script>
<script type="text/javascript">
var allMarks = [];
google.load("maps", "2");
//This function will help us to add the mark at
//location where user has double clicked. Then
//we will add all the marks in our array so that
//we can send it back to the controller
function initialize() {
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
marker = new google.maps.marker
map.setUIToDefault();
GEvent.addListener(map, "dblclick", function(overlay, latlng) {
if (latlng) {
var mark = new GMarker(latlng);
allMarks.push(latlng);
map.addOverlay(mark);
}
});
}
google.setOnLoadCallback(initialize);
//This function will be called for saving the mark
//for that it will send the data back to the controller
function saveMap() {
//gmap object with all values of the map mark
var gmap = {
Locations: allMarks,
Description: Description.value
}
//Ajax call for saving the data at the server. It will send the gmap
//object tot the server
$.ajax({
type: "POST",
url: "/Home/Create",
data: gmap
});
}
</script>