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

  • Home
  • SEARCH
  • 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 6540927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:02:27+00:00 2026-05-25T11:02:27+00:00

wondering if you could shed light for me please! I’m using http://jquery-ui-map.googlecode.com/svn/trunk/demos/google-maps-jquery-filtering.html and I

  • 0

wondering if you could shed light for me please!

I’m using http://jquery-ui-map.googlecode.com/svn/trunk/demos/google-maps-jquery-filtering.html and I have the filter working locally when the markers are being created and tagged by the script.

However I’m bringing in my map pointers from a kml file rather than through the script.

So for that I’m using

var road = new google.maps.KmlLayer( 
                        'http://www.mylivesite.ie/temp/20110627.kml',
                        {preserveViewport:true}
                        );

                    road.setMap(map);

The points load fine but I need a way to filter points in it.

The original example uses tags to filter..

                var tag = "jQuery";
                    for ( i = 0; i < 40; i++ ) {
                        if ( i > 10 ) { tag = "Google maps"; }
                        if ( i > 20 ) { tag = "Plugin"; }
                        if ( i > 30 ) { tag = "SEO"; }
                        $('#map_canvas').gmap('addMarker', { 'tag':tag, 'title':tag, 'bound':false, 'position': new google.maps.LatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()) } );
                    }


                    $("#tags").change(function() {
                        var bounds = new google.maps.LatLngBounds();
                        var tag = $(this).val();
                        if ( tag == 'all' ) {
                            $('#map_canvas').gmap('findMarker', 'tag', tag, function(found, marker) {
                                marker.setVisible(true); 
                                bounds.extend(marker.position);
                                marker.map.fitBounds(bounds);   
                            });
                        } else {
                            $('#map_canvas').gmap('findMarker', 'tag', tag, function(found, marker) {
                                if (found) {
                                    marker.setVisible(true); 
                                    bounds.extend(marker.position);
                                    marker.map.fitBounds(bounds);
                                } else { 
                                    marker.setVisible(false); 
                                }
                            });
                        }
                        $('#map_canvas').gmap('option', 'center', bounds.getCenter());
                    });

But I couldn’t figure out how to add these tags to the kml, so I decided I would try to use the tag thats already in there to filter.

Anyone know how to target items using a styleURL reference instead? I tried targetting an id instead of tag but that doesnt seem to work. e.g.

var tag = $(this).id(); 

Would be grateful for any help please! Either in referencing from styleURL or where to place tags in KML for them to act the same as putting em in through the code.

Thanks in advance

leapin

  • 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-05-25T11:02:27+00:00Added an answer on May 25, 2026 at 11:02 am

    As far as I know there is no way to do this in the current Google Maps v3.6 API (using KMLLayer), to make it work you’d have to parse the KML yourself and then loop through it and add the markers with a tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to ASP.NET and was wondering if anyone could shed some light
Just wondering if someone could shed some light on a problem I'm having. The
Hi I'm wondering if anyone could shed some light on the following problem for
This is bizarre, I was wondering if anyone could shed some light on why
Hi wondering if perhaps someone could shed some light on the below error. The
I was wondering if someone here could shed some light on some questions I
I was wondering if somebody could shed some light on this browser behaviour: I
I was wondering if anyone could shed some light on improvements I can do
I was wondering how could I reload any website using javascript and set it
Just wondering if anyone can shed some light on the basics of getter setters

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.