user2795842
user2795842

Reputation: 1

KML file from Massachusetts GIS - display in Google Maps API

I've been pulling KML files from the Mass GIS service via their export feature: http://maps.massgis.state.ma.us/map_ol/oliver.php

For example, a KML output of Population Density per Square Mile looks like this when exported: http://evrkusd.fatcow.com/populationpersquaremile.kml

I try to add it to my Google Map and nothing shows up, although this code works fine with other kml files from other sources. var NewLayer = new google.maps.KmlLayer('http://evrkusd.fatcow.com/populationpersquaremile.kml'); NewLayer.setMap(map);

I'm getting the idea that some of the kml tags are outdated or are not accepted by Google Maps API.

Is anyone able to get this file to work for them? Any ideas how I can (preferably easily) update this file to work with Google Maps? I'm going to be using multiple KML files like this, so I'm hoping I can do a fairly quick fix.

Upvotes: 0

Views: 961

Answers (2)

geocodezip
geocodezip

Reputation: 161324

Your KML file is still too big:

http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/populationpersquaremile.kml

If you click on the "load KmlLayer" button, it will show you the status return by attempting to load that file in KmlLayer:

Kml Status:DOCUMENT_TOO_LARGE

Your "partial" KML files are not valid xml, if I make the one you posted valid, it works with geoxml3, but the Google Maps API v3 KmlLayer still says it is too big.

See the documentation, the maximum fetched size of a raw KML file is 3M, your file is 7M+.

Upvotes: 1

Rod McChesney
Rod McChesney

Reputation: 681

Fusion Tables can handle much larger KML than client-side maps, up 100MB total (though some limits apply to features). So that might be a solution.

Upvotes: 0

Related Questions