GPX to Google Earth API - google-maps

I have a website that users can download GPX files from and the manually upload them into Google Earth to view their journey. Is there a way to connect the website to Google Earth to automatically show them their journey rather than them having to download and reupload?

Google Earth natively understands KML format but can also convert other formats (E.g. GPX, Shapefiles, CSV, etc.) into KML to view locally.
If the website URLs provided KML then you could create a KML file with a Networklink which would automatically load the latest content when Google Earth was started and display the KML features.
But being the source are GPX files, Google Earth first needs to import and convert those files into KML to display. GPX is just XML and relatively easy to convert into KML so you may consider programatic scripting or coding options to fetch the GPX files then convert them into KML.

Related

How can we display the dynamic kml files data with in the Arcgis online maps

Hi I have developed a website using google maps.My map will display the markers based on the kml files data which is on my server.Now I want to change the maps to Arcgis Online .Can I display the same kml files data with the Arcgis online maps ?
My kml files data will be changed accordingly.The total website is depends upon the kml files.
please suggest me whether I can change from google maps to Arcgis online.
Note:I dont have much idea on java and .net so Can I make an attempt to Arcgis online maps
As long as your KML is accessible to the web application user, you can display it using the ArcGIS API for JavaScript. Use the KMLLayer class. Note that this class requires a connection to ArcGIS Online, which converts the KML.

KML file from Massachusetts GIS - display in Google Maps API

I've been pulling KML files from the Mass GIS service via their export feature:
http://maps.massgis.state.ma.us/map_ol/oliver.php
For example, a KML output of Population Density per Square Mile looks like this when exported:
http://evrkusd.fatcow.com/populationpersquaremile.kml
I try to add it to my Google Map and nothing shows up, although this code works fine with other kml files from other sources.
var NewLayer = new google.maps.KmlLayer('http://evrkusd.fatcow.com/populationpersquaremile.kml');
NewLayer.setMap(map);
I'm getting the idea that some of the kml tags are outdated or are not accepted by Google Maps API.
Is anyone able to get this file to work for them? Any ideas how I can (preferably easily) update this file to work with Google Maps? I'm going to be using multiple KML files like this, so I'm hoping I can do a fairly quick fix.
Your KML file is still too big:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_kmltest_linktoB.html?filename=http://www.geocodezip.com/geoxml3_test/populationpersquaremile.kml
If you click on the "load KmlLayer" button, it will show you the status return by attempting to load that file in KmlLayer:
Kml Status:DOCUMENT_TOO_LARGE
Your "partial" KML files are not valid xml, if I make the one you posted valid, it works with geoxml3, but the Google Maps API v3 KmlLayer still says it is too big.
See the documentation, the maximum fetched size of a raw KML file is 3M, your file is 7M+.
Fusion Tables can handle much larger KML than client-side maps, up 100MB total (though some limits apply to features). So that might be a solution.

Google Earth loads KML 2.2 but not Google Maps

The Google maps script I have seems to load the example KML from Chicago files fine, but when I add my own, it fails. The KML standard is 2.2 - why doesn't Google Maps manage to read it (Google Earth seems to work fine)? When I tried to validate the file it said there were some errors - is there any way around it given that this is an output I get from an application?
geoxml3, KmlLayer and Google Maps load your kml for me. My server doesn't support KML with the .kml extension, just as XML with the .xml extension because it isn't configured for the KML/KMZ MIME types, you might have the same problem on your server.
See this issue on the Google Maps API v3 issue tracker regarding the "spikes" on the line.
Another option would be to to see what KmlLayer.getStatus() returns (Kml Status:DOCUMENT_NOT_FOUND). The cta.kml example returns Kml Status:OK.

Can I display some KML on a Google Map?

Is it possible to have some KML hardcoded into some Html page and have google maps display that hardcoded KML to a google map?
Right now, I keep seeing documentation that requires the KML to be located somewhere else -> an HTTP endpoint on some webserver (which is not what I want).
Any ideas?
The geoxml3 KML parser will parse a KML string embedded in your page and display it on the map (as native Google Maps API v3 objects, not a KmlLayer, that does require a publicly available KML file).

Importing CSV File to Google Maps

I have an quite big CSv File I want to have in Google Maps or just on a map. These are just coordinates but I have 600.000 of them..
Do you have any Idea how I can do this?
I've added an screenshot from XTabulator below:
We have now (jan2017) a csv layer import inside Google Maps itself.
Google Maps > "Your Places" > "Open in My Maps"
GPS Visualizer has an interface by which you can cut and paste a CSV file and convert it to kml:
http://www.gpsvisualizer.com/map_input?form=googleearth
Then use Google Earth. If you don't have Google Earth and want to display it online I found another nifty service that will plot kml files online:
http://display-kml.appspot.com/
none of that needed.... just go to:
http://www.gpsvisualizer.com/
now and load your csv file as-is. extra columns and all. it will slice and dice and use just the log & lat columns and plot it for you on google maps.
The easiest way to do this is generate a KML file (see http://code.google.com/apis/kml/articles/csvtokml.html for a possible solution). You can then open that up in Google Maps by storing it online and linking to it from Google Maps as described at http://code.google.com/apis/kml/documentation/whatiskml.html
EDIT: http://www.gpsbabel.org/ may let you do it without coding.
For generating the KML file from your CSV file (or XLS), you can use MyGeodata online GIS Data Converter. Here is the CSV to KML How-To.