-1

I have a tool using the Google Maps API. I load KML polygons from a huge KML database, containing all KML for every city in France. Then I merge them to create a complex KML containing multiple cities.

I used to call an old Maps API version, and the auto-fit was automatic: it detected the bounds of my KML file, and then adjusted the map zoom to give the user the best zoom level.

But now, when I arrive into the map, the zoom level is so low that I can't see anything.

It seems that, with the new API version, we have to use the fitBounds() methods, giving to it the min/max bounds that we want...

It is impossible! My KML are loaded from a database, and they can contain thousands of polygons, coordinates, pointers...

How am I suppose to deal with that ? Is there a way (for example with a library such as GeoXML3) to get min and max bounds of a complex KML ?

geocodezip
  • 158,664
  • 13
  • 220
  • 245
Pete_Gore
  • 594
  • 1
  • 5
  • 20
  • Please provide a [mcve] that demonstrates your issue. If the KML is the same, the v3 API KmlLayer should also zoom and center the map to show the contents of the KML (by default, unless you tell it not to). I suspect you have changed something. – geocodezip Feb 17 '17 at 12:37
  • Ok I checked everything and I found the reason of this behaviour. – Pete_Gore Feb 21 '17 at 14:18

1 Answers1

0

Ok I checked everything and I found the reason of this behaviour. The fact is that I had an invisible point at another place in the map (invisible because it called a "not found" PNG file). I fixed it and the auto-fit works well. Sorry about that.

Pete_Gore
  • 594
  • 1
  • 5
  • 20