kml

How to get the KML data from a GGeoXml object

白昼怎懂夜的黑 提交于 2020-01-05 04:48:20
问题 I load an KML file into a google map object using the following code: map = new GMap2(document.getElementById("map_canvas")); geoXml = new GGeoXml(kml); GEvent.addListener(geoXml, "load", function() { geoXml.gotoDefaultViewport(map); // I would like to read the KML contents here }); map.addOverlay(geoXml); // ... I would like to read the placemarks from the KML file and display them in a list. I know that the information I need is being transferred to the browser but I don't know how to

How to get the KML data from a GGeoXml object

夙愿已清 提交于 2020-01-05 04:48:17
问题 I load an KML file into a google map object using the following code: map = new GMap2(document.getElementById("map_canvas")); geoXml = new GGeoXml(kml); GEvent.addListener(geoXml, "load", function() { geoXml.gotoDefaultViewport(map); // I would like to read the KML contents here }); map.addOverlay(geoXml); // ... I would like to read the placemarks from the KML file and display them in a list. I know that the information I need is being transferred to the browser but I don't know how to

How to get KML of route with waypoints?

人盡茶涼 提交于 2020-01-04 07:14:52
问题 I need to draw routes in my android app's MapView and to do so I'm using the coordinates listed in the KML output file of Google Maps. The problem is: when I add a waypoint to a route, the KML file doesn't contain the complete route details and only shows the coordinates/directions from the source to the waypoint. Here is an example. As you can see, the route is drawn correctly and all the directions are shown, but the KML output only has the details from the source to waypoint. A solution is

How do i get the coordinates of all four corners of a Rectangle?

丶灬走出姿态 提交于 2020-01-04 06:39:48
问题 How can i retrieve OR calculate the coordinates of the NW or SE corners of a Rectangle? I'm using Google Maps API v3 and I know there is the getBounds() method which returns the NE and SW coordinates of the rectangle. I need all four coordinates because KML 2.2 does not have a rectangle schema spec, it only has the polygon schema and i need to be able to export my rectangle into a kml as a polygon. 回答1: NW coordinates - (x1, y1) SE coordinates - (x2, y2) NE coordinates - (x2, y1) SW

JavaScript In KML Ignored By Google Earth Plugin

瘦欲@ 提交于 2020-01-04 04:11:10
问题 I've created a simple KML file that works in the standalone Google Earth client, but won't work at all in the Google Earth Plugin (regardless of browser): <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Folder> <name>South Florida</name> <open>1</open> <Document> <name>Miami</name> <Style id="miami_style"> <IconStyle> <Icon>

KML to string in Python?

a 夏天 提交于 2020-01-02 20:17:31
问题 I'd like to download a KML file and print a particular element of it as a string in Python. Could anyone give me an example of how to do this? Thanks. 回答1: Downloading and parsing I'll leave to the other answer. Here's how I retrieved the description and coordinates for each placemark in a KML file. namespace = {'ns' : 'http://www.opengis.net/kml/2.2'} placemarks = doc.xpath('//ns:Placemark', namespaces=namespace) for placemark in placemarks : for description in placemark.xpath('.//ns

finding shortest paths using google maps for a large number of nodes

依然范特西╮ 提交于 2020-01-01 22:13:47
问题 I'm trying to do some network analysis for a client. The provided road-network GIS layer is of bad quality; therefore, I have to resort to Google maps to provide me shortest path between 200 points, to produce time and distance matrices between each point. is there a way i can input the layer as a set of KML points to obtain outputs of the distance and time between these points ? if this is doable via the api, do you have any hints or suggestions on how to write such a script? EDIT the ideal

Google Map KML layer placemark click event return ZERO_RESULTS

折月煮酒 提交于 2020-01-01 09:09:31
问题 Attaching listener to KML layer: var layer = new google.maps.KmlLayer('http://sites.google.com/site/kmlprototypes/kmls/temp.kml?dc_=' + Math.random(), {suppressInfoWindows:true,preserveViewport:true}); layer.setMap(map); google.maps.event.addListener(layer, 'click', function (obj) { alert(obj.featureData.id); }); KML file is valid (checked by validation api), you may find it here. Each placemark in XML has id attribute like: <Placemark id="46"> <Style> <IconStyle> <Icon> <href> <![CDATA[http:

Google Map KML layer placemark click event return ZERO_RESULTS

隐身守侯 提交于 2020-01-01 09:09:12
问题 Attaching listener to KML layer: var layer = new google.maps.KmlLayer('http://sites.google.com/site/kmlprototypes/kmls/temp.kml?dc_=' + Math.random(), {suppressInfoWindows:true,preserveViewport:true}); layer.setMap(map); google.maps.event.addListener(layer, 'click', function (obj) { alert(obj.featureData.id); }); KML file is valid (checked by validation api), you may find it here. Each placemark in XML has id attribute like: <Placemark id="46"> <Style> <IconStyle> <Icon> <href> <![CDATA[http:

How do I generate a KML file in ASP.NET?

安稳与你 提交于 2020-01-01 08:18:13
问题 How do I generate and return a KML document directly to the browser without writing a temporary file to the server or relying on a 3rd party library or class? 回答1: I suggest you consider using an HTTP Handler instead of a ASP.NET page. It will be cleaner and more performant. Just add new item of type "Generic Handler" to your project and consider moving the code to its ProcessRequest method. The general approach is good, though. By the way, unless you are explicitly mapping .kml files to an