KML Layers limit to 5?

419 views
Skip to first unread message

wnz

unread,
Jun 1, 2012, 1:38:17 PM6/1/12
to Google Maps JavaScript API v3
My map page loads a dozen of KML layers. Users can interactively turn
on or off a particular layer. It used to work perfectly. Yesterday I
noticed that it's now can only display up to 5 KML layers at the same
time. If five KML layers already display on the map, when I turn on
the 6th layer, nothing shows up on the map until I turns on the first
5 layers. What's happened?

This page uses API v3. I have another page with API v2. It appears to
have the same KML layer limit.

Chris Broadfoot

unread,
Jun 4, 2012, 12:02:46 AM6/4/12
to google-map...@googlegroups.com
Hi,

This has been fixed.

Cheers

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


geoco...@gmail.com

unread,
Jul 6, 2012, 1:47:34 AM7/6/12
to Google Maps JavaScript API v3
On Jul 1, 11:13 pm, Gill <kaifg...@gmail.com> wrote:
> I've uploaded the markers in Google Maps API v3, now I am trying to add the
> side bar where users can interactively on/off the layers. Could you please
> tell me the exact code for this?

Markers with clickable sidebar (translated from Mike Williams' v2
tutorial):
http://www.geocodezip.com/v3_MW_example_map2.html

Markers with clickable sidebar from KML (since that is in the title of
the thread you replied to), uses geoxml3 third party parser:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_us_states_kml_test.html
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_icon_linkto.html?filename=http://www.geocodezip.com/geoxml3_test/visualisationmagazine_com_lacreativemap_kml.xml

-- Larry

Gill

unread,
Jul 6, 2012, 1:58:35 AM7/6/12
to google-map...@googlegroups.com
Thanks Larry,

But this couldn't help me. I want to on/off the layers (markers or kmls) through the side bar.

Kaif

geoco...@gmail.com

unread,
Jul 6, 2012, 2:33:07 AM7/6/12
to Google Maps JavaScript API v3
You mean like this?
http://www.geocodezip.com/v3_MW_example_categories.html
(also translated from Mike Williams' v2 tutorial)

-- Larry


>
> Kaif

Gill

unread,
Jul 6, 2012, 2:57:33 AM7/6/12
to google-map...@googlegroups.com
yes i mean like this. But still I couldn't find the exact code.

My java script code is

(function() {
  window.onload = function() {
  var map = document.getElementById('map'); 
  var pakistan = new google.maps.LatLng(30.7311, 70.7412);    
  var options = {    
      center: pakistan,     
      zoom: 5,     
      mapTypeId: google.maps.MapTypeId.TERRAIN};
 
  var map = new google.maps.Map(document.getElementById("map"),  options);

  google.maps.event.addListener(map, 'click', function() {
        infowindow.close();
        });

var mango = new google.maps.Marker({
      position: new google.maps.LatLng(31.5758, 74.3269),
       map: map,
      icon: 'http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png',
       title: 'Mango'
       });
   var infowindow = new google.maps.InfoWindow({
       content:'Mango'
       });
   google.maps.event.addListener(mango, 'click', function() {
   infowindow.open(map, mango);
   });
 
   var places = [];
      places.push(new google.maps.LatLng(30.7311, 70.7412));
      places.push(new google.maps.LatLng(29.9833, 73.2667));
      places.push(new google.maps.LatLng(24.8508, 67.0181));
    for (var i = 0; i < places.length; i++) {
    var marker = new google.maps.Marker({
    position: places[i],
    map: map,
    icon: 'http://gmaps-samples.googlecode.com/svn/trunk/markers/green/marker1.png',
    title: 'Orange ' + i
    });
    (function(i, marker) {
    google.maps.event.addListener(marker, 'click', function() {  
    var infowindow = new google.maps.InfoWindow({           
    content: 'Orange ' + i
    });   
    infowindow.open(map, marker);});  
    })(i, marker);

  var ctaLayer = new google.maps.KmlLayer('https://dl.dropbox.com/u/83672293/wildlife-national-parks-pakistan.kml');
  ctaLayer.setMap(map);

   }
  }
 
})();

I want to add three layers with check-boxes in the side bar i.e. for mango, places and for kml layer.

Will you please help me in writing the code for this.

Thanks,

geoco...@gmail.com

unread,
Jul 6, 2012, 3:04:09 AM7/6/12
to Google Maps JavaScript API v3
> google.maps.KmlLayer('https://dl.dropbox.com/u/83672293/wildlife-national-parks-pakistan.km...
>   ctaLayer.setMap(map);
>
>    }
>   }
>
> })();
>
> I want to add three layers with check-boxes in the side bar i.e. for mango,
> places and for kml layer.
>
> Will you please help me in writing the code for this.

Did you search this group? There are lots of examples that were
posted to the group. Not sure if they all still work:

https://groups.google.com/group/google-maps-js-api-v3/search?group=google-maps-js-api-v3&q=toggle+KmlLayer&qt_g=Search+this+group

-- Larry

>
> Thanks,

mine

unread,
Jul 6, 2012, 3:05:57 AM7/6/12
to google-maps-js-api-v3
who are you


------------------ Original ------------------
Date:  Fri, Jul 6, 2012 03:04 PM
To:  "Google Maps JavaScript API v3"<google-map...@googlegroups.com>;
Subject:  [Google Maps API v3] Re: KML Layers limit to 5?
Reply all
Reply to author
Forward
0 new messages