Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Clicking on marker generate popup on google map

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 359
    Comment on it

    By using this function, when we will click the marker, a popup will be shown on map. Here we have a function , first we will assign the content to a string name, then we will pass that value to the function . Watch below:-

    function initialize() {
     var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
     var mapOptions = {
     zoom: 8,
     center: myLatlng
     };
     var infowindow = new google.maps.InfoWindow({
     content: contentString
     });
     var marker = new google.maps.Marker({
     position: myLatlng,
     map: map,
     title: 'Evon'
     });
     google.maps.event.addListener(marker, 'click', function() {
     infowindow.open(map,marker);
     });
    }
    google.maps.event.addDomListener(window, 'load', initialize);
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: