kml

Generate PDF on the server from Google Maps API?

你说的曾经没有我的故事 提交于 2019-12-04 09:08:45
We have a hosted web app that uses the Google Maps API for various types of geographical reports, using a combination of the javascript API for adding markers and shapes, plus KML overlays for other layers. There's some demand from customers for turning these into nice downloadable & printable PDF maps. I'm not sure where to begin with that. Any ideas? As Mark Storer pointed out, you can use wkhtmltopdf . If you have polylines or other stuff in your map you will likely need wkhtmltopdf to wait for all the pieces to be in place before generating the PDF. This can be done with the latest version

Using an existant Google 'My Places' map with Maps API v3 styling

谁说胖子不能爱 提交于 2019-12-04 08:59:21
I am trying to use my custom styling created through Google Maps API v3 with an existant map I created through the My Places tool online, without downloading the KML data. Here is a link to my map with the KML data: https://maps.google.co.uk/maps/ms?msid=214652605574280498452.0004d3cc7c556a8346d32&msa=0 I saw a previous question which addressed this issue: Query existing, public Google Map via the Google Maps API v3 However, rather than downloading the KML data, is there a way to use my map directly? I need to later make changes to the place markers without having to download the KML each time

How to toggle between KML/KMZ layers in Google Maps api v3

青春壹個敷衍的年華 提交于 2019-12-04 08:47:35
问题 I'm developing a web page with a Google maps application. Currently, I have a functional search bar and map that displays three KML/KMZ layers. I need to be able to toggle between each of the layers, either display one of them, two of them or all three. There is a similar function in Google Earth, but I need it in Google Maps. How can I do this? Here is my code for the map and search bar: <script type="text/javascript"> var geocoder; var map; var marker; function initialize() { geocoder = new

Openlayers write and save a KML based on your map

元气小坏坏 提交于 2019-12-04 08:39:18
问题 Is it possible to write and save a KML from OpenLayers? Anyone know of an example of exporting one? 回答1: You can export only the vector features to KML. function GetKMLFromFeatures(features) { var format = new OpenLayers.Format.KML({ 'maxDepth':10, 'extractStyles':true, 'internalProjection': map.baseLayer.projection, 'externalProjection': new OpenLayers.Projection("EPSG:4326") }); return format.write(features); } UPDATE In order to force the browser to download the KML string as a KML file

How to override target=_blank in KML popups in embedded Google map?

我与影子孤独终老i 提交于 2019-12-04 07:29:51
I'm using KML to overlay shapes on a Google map. Information corresponding to each shape is included in the <description> element, along with a link to a detail page corresponding to that shape. So for example, my KML includes this: <description> <![CDATA[ <div> ... <p> <a href="Concession.20.aspx">View details</a> </p>   </div> ]]> Of course, I would like for that link to open in the same window, since it's just navigating to another page on this same site. Unfortunately, as documented here , links embedded in the <description> element of a KML file are rewritten with target='_blank' .

Using pyKML to parse KML Document

主宰稳场 提交于 2019-12-04 07:24:39
I'm using the pyKML module for extracting coordinates from a given KML file. My Python code is as follows: from pykml import parser fileobject = parser.fromstring(open('MapSource.kml', 'r').read()) root = parser.parse(fileobject).getroot() print(xml.Document.Placemark.Point.coordinates) However, on running this, I get the following error: ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration. Looking for solutions, I came across this solution http://twigstechtips.blogspot.in/2013/06/python-lxml-strings-with-encoding

unzip strings in javascript [closed]

本小妞迷上赌 提交于 2019-12-04 06:04:09
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Anyone knows a simple JavaScript library implementing the UNZIP algorithm? No disk-file access, only zip and unzip a string of values. There are ActiveX, using WinZIP and other client dependent software for ZIP, written in JS. But no pure JavaScript algorithm implementation. I would use it for displaying KMZ files in a HTML page with the GMap object (google maps). The KMZ file is just a zipped KML

Show Value next to line in google maps

谁说我不能喝 提交于 2019-12-04 05:39:20
问题 I've created a KML file with lines corresponding with roads (see the picture for 1 road/link). I changed the linewidth and color to distinguish types of the roads. I've got 2 questions about the layout: 1) I would like to add and rotate a value along the line. Is that possible using KML file or have i use another method (like 4.32 in the picture)? 2) Is it possible to show the end cap of a line as a 'square' ? (default in my KML is rounded) Thanks you so much! Example (question 1): 回答1: For

Issue with infowindows remaining active when another KML layer is selected - Google Maps API V3

我的梦境 提交于 2019-12-04 04:57:03
问题 I've got multiple kml layers that are loaded into my Google Map API V3 using tick boxes. When two or more layers are selected the infowindows on one layer don't automatically collapse when markers are clicked on other layers. I'd like the infowindows to close automatically even though they are on different KML layers - Any pointers in the right direction will be helpful. Thanks Darren Wilson 回答1: You need to disable the default info window creation and handle the infowindow yourself in code.

Google Map KML layer placemark click event return ZERO_RESULTS

夙愿已清 提交于 2019-12-04 03:48:37
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://chart.apis.google.com/chart?chf=bg,s,EAF7FE02&chxt=y&chbh=a,4,4&chs=48x48&cht=bvg&chco=FF0000,0000FF