Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:50:21+00:00 2026-06-14T05:50:21+00:00

I need to get marker icon url on click, I saw on google maps

  • 0

I need to get marker icon url on click, I saw on google maps documentation that there is function getIcon() but don’t know where to call it.

  google.maps.event.addListener(layer, 'click', function (kmlEvent) {
                    alert(kmlEvent.getIcon());//Object #<Object> has no method 'getIcon'
                    showInContentWindow(map, kmlEvent);
                });

Update:

    var myOptions = {
        zoom: 8,
        center: null,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };

    var map = new google.maps.Map(document.getElementById("kmlMapCanvas"), myOptions);

    var layer = new google.maps.KmlLayer(
    'https://maps.google.co.uk/maps/ms?msid=207817312541605896974.0004cdbf70e9c541de0ac&msa=0&ll=51.499019,-0.58382&spn=0.070103,0.209255&output=kml',
    {                       
      suppressInfoWindows: true,
      map: map
    });

    google.maps.event.addListener(layer, 'click', function (kmlEvent) {
             alert(kmlEvent.getIcon());//Object #<Object> has no method
        showInContentWindow(map, kmlEvent);
    });

where I am losing connection with native marker….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:50:22+00:00Added an answer on June 14, 2026 at 5:50 am

    You can’t access the icon if you render your KML using KmlLayer. If you use a third party parser, like geoxml3 or geoxml-v3, which renders the KML using native Google Maps API v3 markers, you can access the icon, using the getIcon() method on the marker.

    Your KML displayed with geoxml3

    The urls of the icons are:

    geoXmlDoc.placemarks[0].marker.getIcon().url
    geoXmlDoc.placemarks[1].marker.getIcon().url
    geoXmlDoc.placemarks[2].marker.getIcon().url
    

    This works on that page (in the address bar, at least in IE):

    javascript:alert(geoXmlDoc.placemarks[0].marker.getIcon().url);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the contents from this URL http://google.fr/ok in a NSString can
I need to create a route in google maps involving multiple waypoints, but google's
I know there are hundreds of questions about this, but I need to get
I need to automatically change Google Maps marker icons based on the inner content
I have a marker in a google maps . I use this marker to
I need yours help. I get parameters (markers and polygons) of mine Google Map
using jquery-ui-map here is my code $(document).ready(function() {$('#map_canvas').gmap({ 'center': new google.maps.LatLng(3.162456,21.09375), 'zoom': 2, 'streetViewControl':
I need to get a simple count of users that have >5 accounts tagged
I've managed to add markers to a Google Map on click, but now I
I need to find out if certain LatLngs are inside a Google Maps Circle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.