kml

Access KML placemarks in a Google Maps overlay via Javascript?

雨燕双飞 提交于 2020-01-01 06:42:44
问题 I have a KML file overlay on an embedded Google Map using the GGeoXml object. I'd like to be able to access specific placemarks in the KML file from Javascript (for example to highlight a selected polygon on the map in response to user action). Ideally what I'd like to do is something like this (pseudo-code): geoXml.getPlacemarkByName('Foo').focus(); Unforunately the Google Maps API doesn't seem to expose the placemarks or any other internals of the KML overlay. Does anyone have any thoughts

KMLViewer Apple's example not working

旧巷老猫 提交于 2019-12-31 02:14:10
问题 I've been searching for quite sometime an answer to my problem with no success. So here it goes... KMLViewer, Apple's example is not working in some cases. After executing the README steps, i've tried to build up a route between Lisboa, Portugal and Porto, Portugal. And here the strangest thing happens. The annotations are built correctly, although the overlay (MKPolyline) does not, it only draws part of the route and it starts drawing in the middle of an "annotation". What am i missing ? You

Read kml file with multiple placemarks in pykml

别来无恙 提交于 2019-12-30 10:29:40
问题 In pykml, I can read the first placemark in a file using the following code: with open(filename) as f: pm = parser.parse(f).getroot().Document.Folder print "got :" print pm.Placemark.LineString.coordinates How can I read multiple placemarks in the same file into python? 回答1: Edit: An even easier solution, assuming all placemarks are in one folder: from pykml import parser with open(filename) as f: folder = parser.parse(f).getroot().Document.Folder for pm in folder.Placemark: print(pm.name)

Accessing ExtendedData information via Google Maps API v3

情到浓时终转凉″ 提交于 2019-12-30 10:06:18
问题 I have a KML file which contains within each <Placemark> node an <ExtendedData> node, and then a number of <Data> nodes with key/value pairs. I've followed the examples at: http://code.google.com/apis/kml/documentation/extendeddata.html and code.google.com/apis/kml/documentation/kmlelementsinmaps.html suggests maps do support KML ExtendedData nodes (albeit partially), but I cannot find a way of accessing the ExtendedData object via javascript. I'm using: google.maps.event.addListener(agency

Mapbox: Filtering out markers in a Leaflet Omnivore KML layer

徘徊边缘 提交于 2019-12-25 18:24:38
问题 I am exporting Google Directions routes as KML and displaying them on a Mapbox map by reading them with Omnivore and adding them to the map, The Google KML stores each route as two Places (the start and end points) and one LineString (the route). In Mapbox I would like to show only the routes, that is to filter out the markers somehow. I'm displaying markers out of my own database and the Google markers clutter it up. Here is my code. I change the styling of the LineStrings just to show that

google map api (KML layer)

走远了吗. 提交于 2019-12-25 11:56:25
问题 I tried to draw boundaries of HK island by using KML. Supposed, there would be polygon lines on the map of the Hong Kong island. But nothing shown. Why? Any other methods to import data with coordinates of polygon to google map api? THANKS ! <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0"> <meta charset="utf-8"> <script src="http://maps.google.com/maps/api/js?v=3&sensor=false" type="text/javascript"></script> <title>KML Layers</title> <style> html, body {

PHP Dynamically creating KML for multiple placemarks on map

眉间皱痕 提交于 2019-12-25 09:51:50
问题 Currently struggling with PHP and creating KML from it. I'm using the last.fm API (geoGetevents) to grab events from 'location' (for example, user searches for Manchester) and then (using KML - as I feel more comfortable with it than JS) plot these on a map. I'm finding that I get invalid KML/KMZ errors when linking to a google map from my feed. Having said that, I know why.. Everything is contained in one file - including the KML that PHP generates. So with GET variable, the URL is http:/

PHP Dynamically creating KML for multiple placemarks on map

ぃ、小莉子 提交于 2019-12-25 09:51:38
问题 Currently struggling with PHP and creating KML from it. I'm using the last.fm API (geoGetevents) to grab events from 'location' (for example, user searches for Manchester) and then (using KML - as I feel more comfortable with it than JS) plot these on a map. I'm finding that I get invalid KML/KMZ errors when linking to a google map from my feed. Having said that, I know why.. Everything is contained in one file - including the KML that PHP generates. So with GET variable, the URL is http:/

How to get coordinates of kml file android

六眼飞鱼酱① 提交于 2019-12-25 08:50:05
问题 I want to receive the coordinates of the points that are in the kml file. I created a object that receives the coordinates but I can not find how to take them from the file. An example of what has been done so far: (The amount of points is 132, but I shortened it to be able to present here.) Kml file: <LinearRing> <coordinates> 34.79991805485883,32.070779943443,0 34.799829164854,32.07080649750882,0 34.79971023480251,32.07083335300256,0 34.79959122858838,32.07086022634235,0 34.79947508289758

GeoXML3 accessing KML attribute datas

和自甴很熟 提交于 2019-12-25 08:34:03
问题 My KML File has the following format: <Placemark> <Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style> <ExtendedData><SchemaData schemaUrl="#seb"> <SimpleData name="PR0">CORS</SimpleData> <SimpleData name="PR1">BRB</SimpleData> <SimpleData name="PR2">F15</SimpleData> </SchemaData></ExtendedData> <MultiGeometry><Polygon><altitudeMode>clampToGround</altitudeMode><outerBoundaryIs><LinearRing><altitudeMode>clampToGround</altitudeMode><coordinates>71