Menu
  • HOME
  • TAGS

Base64 encode icon in Google Earth

kml,google-earth

Overlays (screen overlay, ground overlay, etc.) and icon images via Style references in KML are referenced only as URLs either absolute or relative not as inline base64-encoded content which is allowed in other XML standards. Icon Style example with absolute URL: <Style> <IconStyle> <Icon> <href>http://maps.google.com/mapfiles/kml/pal3/icon21.png</href> </Icon> </IconStyle> </Style> Ground Overlay...

Algorithm to calculate speed from kml track gps co-ordinates

android,gps,geolocation,kml,kmz

I think the problem comes of small inaccuracy in the GPS logs. As you take points that are very close from each other (30 - 60 meters) a small variation can nearly double the speed. I believe you could clean your data this way: public double calculateSpeed(Location prev, Location curr,...

GWT GoogleMaps: Display KML Name on Map

java,google-maps,gwt,google-maps-api-3,kml

For anybody stumbling upon this question, what I eventually ended up doing was using Google's chart API: https://developers.google.com/chart/image/docs/gallery/dynamic_icons This allows you to dynamically create images using arguments passed into a URL. Then you can just use that URL to create a MarkerImage or GroundOverlay: MarkerImage mi = MarkerImage.create("http://chart.apis.google.com/chart?chst=d_text_outline&chld=000000|16|h|FFFFFF|_|Example"); MarkerOptions mo...

Show a KML layer

kml,openlayers-3

You need to use the version 3.5.0 instead of 3.4.0 to have the new vector api see release notes

Show Value next to line in google maps

google-maps,google-maps-api-3,kml

For #1 you can add an InfoBox with rotated text along the polyline. For #2, there is no option to modify how the ends of polylines are rendered, you could try putting a square symbol over the end, but it would be a hack. var labelText = "4.32"; var labelDiv...

PHP Script not generating KML file from MySQL data properly - how to correctly approach this?

php,mysql,xml,geolocation,kml

Looks like you are closing the SQL connection after 'Add' and hence getting no result for your select query. } else { echo "Added"; } mysql_close($con); $sql2="SELECT * FROM userActivityLocation"; $result2=mysql_query($sql2); Move mysql_close($con); down to the very bottom of your file and you should be good....

Google Earth Plugin, embedded in Blogger, producing 2 maps

kml,google-earth-plugin,kmz

You have to remove either the call to init() in your onload handler or the call to google.setOnLoadCallback(init), otherwise a map will be added every time you call the init function.

Need to count how many child tag in kml files

php,arrays,json,xml,kml

finally little trick I found do the result $file = 'file.kml'; $xml_file = file_get_contents($file); $xml = simplexml_load_string($xml_file); $decodearray = json_decode(json_encode((array)$xml),1); $nowdatetime = date_create(); $tstamp = date_timestamp_get($nowdatetime); switch (!isset($decodearray['Document']['Folder'][0])) { case true: $docfolder = $decodearray['Document']['Folder']; break; case false: $docfolder = $decodearray['Document']['Folder'][0]; break; } echo count($docfolder['Folder']); simple switch case to indexing array...

On click Data populate in info window of a polygon using GeoXMl3

google-maps,kml,geoxml3

I have finally figured out solution for same. You need to overwrite createPolygon attribute of your parser for same. var districtInfoMap = {doc_url1:infowindow_content1, doc_url2:infowindow_content2 }; var parser = new geoXML3.parser({ createPolygon: mapDrawingToType(), map: map, processStyles: true, zoom: false, singleInfoWindow: true, }); mapDrawingToType = function() { return function(placemark, doc) { var...

How to Display Custom KML Placemark Icon using Image from Local Disk or Network Drive

icons,kml,google-earth

The <href> element in KML takes a URL not a Windows file path. The URL can be an absolute or relative location. To get it working suggest you first move the KML file and the image to the same folder then refer to the image by its filename. <Style id="icon">...

Specific lat lng in KML can't be shown

kml,google-maps-api-2

As geocodezip mentioned, the correct order has to be lng and lat.

iOS cannot parse KML / XML downloaded from server

ios,objective-c,xml,parsing,kml

Ok found the issue. It was to do with how I was accessing the file once downloaded. Once saved to disk I would send it's URL to the parser. The problem was I was using the incorrect NSURL method, I was originally using: NSURL *fileUrl = [NSURL URLWithString:[self pathForFile:self.pathToKmlFileOnDisk]]; Whereas...

Using grid2poly with raster

r,kml,raster,r-raster

Why polygons and not a raster KML? library(raster) tmin <- getData("worldclim", var = "tmin", res = 10) tmin1 <- tmin[[1]] newext <- c(-1, 1, 40, 43.5) tmin1.c <- crop(tmin1, newext) KML(tmin.c, 'test.kml') If you need polygons: p <- rasterToPolygons(tmin.c) and now you can use KML (or kml) again Now to...

KML Document inside Document

kml

Both the Document and Folder elements in KML are container types and it is perfectly valid to have a Document inside a Document, Document inside a Folder, Folder inside a Document, etc. In nearly all cases the Folder and Document can be used interchangeably. Conceptually it makes sense for "Folders"...

Use KML to generate geometry

postgresql,kml,postgis,rails-geocoder,rgeo

I finally did it geometry = GeoRuby::SimpleFeatures::MultiPolygon.new doc = kml =~ /\<kml / ? Nokogiri::XML(kml) : Nokogiri::XML.fragment(kml) doc.search('Polygon').each_with_index do |hpoly,i| poly = GeoRuby::SimpleFeatures::Geometry.from_kml(hpoly.to_s) end geometry.empty? ? nil : geometry The kml file is directly the uploaded file where I applied the open method. I've found a lot of inspiration coming...

Refresh KML stylesheet in Google Earth

kml,google-earth

After checking the map everyday for a week, it started working with the right icon after 9+ days. Im not sure what changed, but it seems like leaving it for a considerable length of time will fix the problem.

Hide KML attributes displayed in bubble

google-maps-api-3,kml

You can't. At least, not while using the native google maps KML Overlay. The two workarounds I can think of are: 1.- Use jQuery or CSS to hide the KML_2 attribute. This is tricky because inspecting elements inside the google maps sandbox needs a lot of trial and error, plus...

Namespace: javax.xml.bind.UnmarshalException: unexpected element

java,xml,exception,jaxb,kml

Since your XML document leverages a default namespace you should use the package level @XmlSchema annotation to map the namespace qualification. The @XmlSchema annotations is added to a special class called package-info that goes in the same package as the domain model and contains the following content. With @XmlSchema specified...

Google Maps geoXML3: passing a placemark into it's own event listener?

javascript,google-maps,kml,geoxml3

Use function closure to associate the placemark with the event listener. One way (you can also use an anonymous function): kml = new geoXML3.parser({ suppressInfoWindows: true, map: map, afterParse: function (doc) { for (var i = 0; i < doc[0].placemarks.length; i++) { var p = doc[0].placemarks[i]; clickablePolygon(p); } } });...

remove the dat tag from a track on google earth

kml,google-earth

if you remain the track name empty this constant part will vanish, the default name is something like this in track block: <name>2009-08-13T17:35:24Z</name> you can remain this empty, simply like this: <name></name> with no harm. ;)...

Creating a document in Java

java,xml,kml,xmldocument

I'm not sure I understand your question, but I'll try to answer: Should the function "addFeatureStyle" return element, or a string, or something else? You're calling the method appendChild() with the value returned by addFeatureStyle("red", "501400FA") as argument. The documentation of appendChild() shows that it takes a Node as argument....

How to extract individual/child nodes from a KML file in VisualBasic?

vb.net,linq,kml,xmlreader

If I have understood you correctly, you are trying to fetch the name & description present inside the PlaceMark node. But, since you are only fetching Root.Elements() your query will only fetch the complete XML starting from your root node. You need to find the Descendants of PlaceMark node because...

USGS Kml Layer is not displaying colors or sizes properly

google-maps,google-maps-api-3,kml,geojson

IconStyle/color and scale are not supported by google maps: https://developers.google.com/kml/documentation/kmlelementsinmaps Using external styles minimizes the size of these frequently changing feeds. USGS offers GeoJSON(P) feeds for embedding in javascript maps, as described on this page: https://developers.google.com/maps/tutorials/data/importing_data#requesting_jsonp USGS GeoJSON feeds are available at: http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php They can converted to GeoJSONP by appending...

Google maps — pop up box

google-maps,kml,popupwindow

You could consider the following approach: 1)suppress a default info window: var kmlOptions = { suppressInfoWindows: true, // do not to display an info window when clicked preserveViewport: false, map: map }; var layer = new google.maps.KmlLayer(url, kmlOptions); 2)register a shared instance of Info Window: var infoWindow = new google.maps.InfoWindow();...

Google Earth - Set Time Slider to Maximum Values

date,time,slider,kml,google-earth

In your master KML file, you need to add <gx:TimeSpan> to a View or Camera element in the top-level container. The gx:TimeSpan controls the visibility of time-stamped Features in a user-defined view. To display everything between 10/09/2015 and 12/04/2015 by default, the structure of KML should look like this. <kml...

Map.panTo not working

javascript,google-maps,google-maps-api-3,kml

Your map variable is local to the initialize function. working fiddle Remove "var" from in front of it inside the initialize function: function initialize() { var mapOptions = { center: new google.maps.LatLng( 38.04798015658998, -84.59683381523666), zoom: 16, disableDefaultUI: true, zoomControl: true, mapTypeId: google.maps.MapTypeId.SATELLITE }; var kmlOptions = { suppressInfoWindows: true, preserveViewport:...

How import all information of location history KML file on Fusion Table?

kml,google-fusion-tables,location-history

The supported geometry-types when you import KML are Linestring, Polygon and Point (see: https://support.google.com/fusiontables/answer/174680 ) This would work: <Placemark> <name>Latitude User</name> <description>Location history for Latitude User from 09/21/2014 to 09/28/2014</description> <Point> <coordinates>99.99999,41.99999,0</coordinates> </Point> </Placemark> ...

KML infowindows glitch when combined w Fusion Tables layers in a Google Map

javascript,google-maps,kml,google-fusion-tables

For FusionTables click events, the .infoWindowHtml is a property of the event. For KmlLayer, the .infoWindowHtml is in the .featureData property of the event. So for KmlLayer click events, you need to use: e.featureData.infoWindowHtml For FusionTables click events, you need to use: e.infoWindowHtml Change suppressInfoWindows:true for all the layers. Change...

Google Maps Api inverts KML Layer after Zoom

javascript,google-maps,google-maps-api-3,kml

Seems like a bug in the KML renderer. As a workaround, you could use a third party KML parser (like geoxml3 or geoxml-v3), geoxml3 doesn't seem to have that artifact: Example using geoxml3 (and a slightly modified KML to cover the whole world) Note that for complex KML the tiled...

Preserving Google map zoom to kml layer on checkbox click

javascript,google-maps,kml

Set the map-property of a selected layer only when it's not set yet: function check() { if(document.getElementById('watersheds').checked) {if(!watershedLayer.getMap())watershedLayer.setMap(map);} else {watershedLayer.setMap(null);} if(document.getElementById('ere1949').checked) {if(!ere1949Layer.getMap())ere1949Layer.setMap(map);} else {ere1949Layer.setMap(null);} } http://jsfiddle.net/jhagmq7L/16/...

Load local KML file using ArcGIS api for android

android,kml,arcgis

Make these changes: Use KmlLayer instead of KMLLayer. KMLLayer supports only KML URLs on the public Internet, and it is deprecated. It will not work for a local KML file. KmlLayer supports both local KML files and KML URLs. Be sure you've given your app permission to access local files:...

Information on a static part

kml,google-earth

In KML you can create a Screen Overlay that is always visible and can be placed at any location of the screen. A collection of samples is included in the Screen Overlays folder in the KML Samples file. As an example, enable the "Absolute Positioning: Top left" folder in the...

Why does this KML line not get plotted in the right place? [duplicate]

google-maps,gis,kml

It's because in my KML i was displaying the points lat/long and they should be long/lat

Google Maps polygons hover gap on Firefox

google-maps,firefox,google-maps-api-3,kml

UPDATE 7/23/15 1:49PM MDT This is a known bug between Firefox and Google Maps, the current workaround is to load the Google Maps js file with "v=3" on it, so load the source using: src="http://maps.google.com/maps/api/js?v=3&sensor=false" or src="http://maps.google.com/maps/api/js?v=3" I have tested this in Firefox 39.0 and this workaround stops the issue...

Hosting kml files on public webserver

kml

Dropbox and Google Drive, for example, hide the actual URL so you have to find the "share" options or download options which will help you find the URL to the actual KML content. Clicking on the file often displays a preview HTML page with information about the file not the...

KMZ displayed incorrectly after Save to My Places and restarting Google Earth

kml,google-earth,kmz

There is a bug in Google Earth with respect to having a KMZ with NetworkLinks whose target has referenced files being saved in the saved places file. When saved the base file path in your KMZ file is changed from the KMZ location to the location of the saved places...

VBA Access: organize assorted records into KML folders

xml,vba,access-vba,kml,folders

First, KML is a special XML file. And Access can export table and query data into XML format. So you can easily export your coordinates data into XML without iterating through a recordset: Application.ExportXML acExportQuery, "yourtableorqueryname", "\path\to\file.xml" However, KML requires special headers which need to be incorporated with your coordinates...

Highlight country around the border from your search area only

javascript,google-maps-api-3,kml,google-fusion-tables

Your code as posted works for me. The two issues are: the 1 meter circle only selects one county (I assume you mean counties not countries). the fill is fairly transparent and the orange lines can't be seen. note that there isn't any real way to query for adjoining/bordering polygons....

Could we use a kml file from localhost? [duplicate]

javascript,google-maps,kml

No (at least not with KmlLayer), KML URLs must be publicly available. localhost is not publicly available. from the documentation displayed on a map using a KmlLayer object, whose constructor takes the URL of a **publicly accessible KML** or GeoRSS file. You can use a third party parser like geoxml3...

Changing my Pin to Custom Image not working in my MKMapView

ios,xcode,annotations,mapkit,kml

The answer provided by Anna above solved the problem See stackoverflow.com/questions/9814988/…. Code is creating an MKPinAnnotationView instead of plain MKAnnotationView. ...

Google Maps mangling KML

google-maps,google-maps-api-3,kml,qgis

I would say that the Google Maps KML rendering engine has some issues. It works when I use the geoxml3 third party parser to render it, but not when I use the Google Maps Javascript API v3 KmlLayer to render it. rendered with geoxml3 Note that the performance with third...

Setting apache server wide variables with python

python,apache,variables,kml

It seems like you have a few options here to share a state: Use a db. file system based persistence a separate daemon process that you can connect to via sockets Use memcache or some other service to store in memory You can share states via python: https://docs.python.org/2/library/multiprocessing.html#sharing-state-between-processes) You can...

geoxml3 removing set center position

google-maps-api-3,kml,geoxml3

set the zoom-option of the parser-options to false var geoXml = new geoXML3.parser({ map: map, singleInfoWindow: false, afterParse: useTheData, suppressInfoWindows : true, zoom : false }); https://code.google.com/p/geoxml3/wiki/ParserReference#geoXML3.parser_Options...

How make iOS UIActivityViewController show “Open in Google Earth” for local KML file?

ios,pdf,kml

You should take a look at the documentation of UIDocumentInteractionController by Apple. I've tried it now and the Open in GoogleEarth option appears when you use that controller. For example to present it from a button (called button) for a path called url in a view controller: UIDocumentInteractionController *interactionController =...

Extract Polygon name and coordinates from a KML using VB.NET

.net,xml,vb.net,kml,google-earth

As far as I can tell, you have the following subproblems: Parse the XML and extract the name and the coordinates. Split the coordinates into some data structure. For step 1, VB's LINQ to XML is the easiest way. The following working code example should help you get started: Imports...

how to display and ignore kml layer in google maps

javascript,google-maps,google-maps-api-3,kml

Change your KML initialization code from: var kmlLayer = new google.maps.KmlLayer(url, { suppressInfoWindows: true, preserveViewport: false, map: map }); to var ctaLayer = new google.maps.KmlLayer( { url: url, suppressInfoWindows: true, map:map, zindex: 0, clickable : false }); Here is a fiddle: http://jsfiddle.net/loanburger/jnrnmog4/ You can click the map and the marker...

Any way I can load KML data from Google maps (again) via JS API?

javascript,google-maps,google-maps-api-3,kml

Found the solution myself. Since Google is serving KML data only zipped (KMZ), there doesn’t seem to be any way anymore to get the actual raw layer data to dynamically build a map from scratch while being able to access and manipulate each marker etc. At least it is possible...

How to update kml file/layer dynamically?

javascript,google-maps,google-maps-api-3,kml,parcel

geoxml3 parses the KML to native google.maps.Polygon objects. You can process those polygons in the afterParse function: var myParser = new geoXML3.parser({ map: map, afterParse: useTheData }); var kml = myParser.parse('kml/SO_20150619a.kml'); function useTheData(doc) { for (var i=0; i < doc[0].gpolygons.length; i++) { var centroid = new google.maps.Marker({map:map,position: get_polygon_centroid(doc[0].gpolygons[i].getPath().getArray())}); } }...

Google MAP KML Auto refresh

dictionary,kml

Some KML elements are not supported in Google Maps. For example, the <refreshVisibility> element is not supported. List of limitations of KML in Maps can be found here: https://developers.google.com/kml/documentation/kmlelementsinmaps There are also some validation errors in your KML. The spelling and order of elements in KML is strict. The visiblity...

Can I animate my mapView like with SatNav

ios,xcode,mkmapview,mapkit,kml

The only way to resolve this issue is import the Google maps framework, which works perfectly well alongside MKMapkit. There is a facility within Google Maps that enables the developer to animate their route....

Placemarks lookat range ignored

kml,google-earth

There are a few undocumented differences when you load KML directly as opposed to via a NetworkLink. When you load the KML via the NetworLink it looks for a LookAt or Camera in the outermost element which is the Document in test.kml file. You can either 1) copy/move the <LookAt>...

Why is Google Earth changing KML polygon coordinates?

xml,google-maps,google-maps-api-3,kml,google-earth

Your original KML coordinates have spaces in the tuples, that is not valid (spaces separate tuples). <coordinates>149.02126, -36.489864, 100 149.3816, -36.31477, 100 149.25783, -36.134285, 100 148.9647, -36.4074, 100 149.02126, -36.489864, 100</coordinates> should be: <coordinates>149.02126,-36.489864,100 149.3816,-36.31477,100 149.25783,-36.134285,100 148.9647,-36.4074,100 149.02126,-36.489864,100</coordinates> ...

Labelled Placemarks in a LineString

java,xml,google-maps,kml

Ended up finding out how to use folder public void map() throws IOException{ for(int i=0; i<getVessels().size(); i++){ if(!getVessels().get(i).getCoordinates().isEmpty()){ FileWriter fstream = new FileWriter("C:\\Users\\Documents\\maps\\" + getVessels().get(i).getMMSI()+ ".kml"); BufferedWriter out = new BufferedWriter(fstream); out.write("<kml>"); out.write("<Folder>"); out.write("<Placemark>"); out.write("<name>"+getVessels().get(i).getMMSI()+"</name>"); out.write("<LineString>");...

Looping through a .KML file and Finding Values in Side a Particular Node?

c#,xml,parsing,kml

Your questions is a little vague in terms of what you're trying to do. You say you want to parse the <Placemark> node but there may be additional <Placemark> nodes among the "junk" in the file. It's unclear whether you want all the <Placemark> nodes or a specific one. So,...

XSLT: replace all href based on text

xslt,kml

Select all href found in InconStyle If href|text() = "y" then replace with "x" That's not exactly what your example shows us. It does "If href|text() contains "y"..." Anyway, try it this way: XSLT 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <!-- identity transform -->...

Networking for R Shiny / R Studio + rMaps with KML

r,networking,kml,leaflet,shiny

There are a few issues here. rCharts overrides rMaps when they are both loaded up. So the Leaflet$new call is actually coming from the rCharts package. Also it is not possible to use the addAssets method that was utilised previously. It is necessary to change the libraries/leaflet/config.yml file and add...

Google maps api kml filling incorrect

javascript,google-maps-api-3,kml

There is a bug in the Google KML renderer. Issue 8015...

Finding if lat/long point is inside a polygon defined by coordinates

php,codeigniter,coordinates,kml,geojson

The point is inside the green boundaries, but you just want to override that with another polygon. Assuming that you have multiple polygons, it might be worth keeping track of whether the polygons are shaded (True) or not shaded (False), or some other combination based on what your algorithm actually...

KML not opening in Google Earth through VB.net

vb.net,kml,google-earth

The problem is the spaces in the path. You can add quotes to the parameter and it should work: gf = """C:\Program Files (x86)\Google\Google Earth\client\abc.kml""" ...

How to simulate a route (.gpx or .kml), on Android?

android,google-maps,kml,google-earth,gpx

I suggest using http://gpx2kml.com/ if you want to convert the kml file to gpx. It's a free online converter and it works both ways.

How to load KML File in folder Assets with Xamarin Android

java,android,xamarin,kml

I think that you can do it like it was a Xml file, but see if this or this helps you.

Icon issue in Google Earth .kml file

google-maps-api-3,kml

This is a known undocumented feature in Google Earth. The Google Maps icons with URL http://maps.google.com/mapfiles/kml/pal*/icon**.png are automatically redirected to one of the standard Google Earth icons. This is documented here (note 2). So from your example, the icon: is redirected to with red fill color. Source URL: http://maps.google.com/mapfiles/kml/pal4/icon18.png And...