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
venky n
NA
110
38.2k
how to use google map in master page file using drop down
Mar 16 2015 1:31 AM
hi,
how to change the location on google map using drop down selected index changed event in master page file....
the below script successfully executed in default page but not working on master page on content page. The google map show but not change the city in dropdown selected index.
src = "http://code.jquery.com/jquery-1.9.1.js";
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false";
$(document).ready(function () {
var gmarkers = [];
var map;
function initialize() {
var mapProp = {
center: new google.maps.LatLng(20.593684, 78.96288), //India Lat and Lon
zoom: 2,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
$("#ddcity1").change(function () {
var city = $("#ddcity1").val();
var geocoder = new google.maps.Geocoder();
var com = city;
geocoder.geocode({ 'address': com }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var x = results[0].geometry.location.lat();
var y = results[0].geometry.location.lng();
var latlng = new google.maps.LatLng(x, y);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("googleMap"), myOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(x, y),
map: map,
title: com
});
var infowindow = new google.maps.InfoWindow({
content: com
});
infowindow.open(map, marker);
google.maps.event.addDomListener(window, 'load');
} else {
res.innerHTML = "Enter correct Details: " + status;
}
});
});
});
plz help me how to change the city in drop down event in content page
Reply
Answers (
1
)
wordtopdf.dll for .net ver 3.5
A beautiful replacement for JavaScript’s “alert”