Pregunta

I have been rendering KML files in the google maps by the geoXML library by the following way.

var geoXml = new geoXML3.parser({
    map : map,
    singleInfoWindow : true
});
geoXml.parse('http://DomainName/GeoSystem/redrawKML');

I came to know by the following way we could render KML files in the google maps.

var ctaLayer = new google.maps.KmlLayer({
   url: 'http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml'
});
ctaLayer.setMap(map);

These two approach made me to ask following, (If it is stupid, I will update it in appropriate way)

  1. Which is faster to render KML Files in google maps and why ?
  2. Which is providing good support for handling events (mouse click, Key press, etc.)
  3. Which is providing best support to validate the KML file which is being rendered from Server.
¿Fue útil?

Solución

geoXML3 was created when maps API v3 did not have native KML support yet. It makes use of other API v3 objects like google.maps.Polygon, of which you can use all it event possibilities.

google.maps.KmlLayer support of events is limited. (only mouse click). There is also a limit of number of KML files which can be displayed on a map: https://developers.google.com/kml/documentation/mapsSupport

the native KML support is probably the most easy one to implement. geoXML3 however gives more possibilities.

both do the same job to validate the KML file

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top