I want to develop a web-application using Google Earth in the browser.
I need to add a point feature, a polyline and a polygon.
The web-applicaton needs to display the features the same as the Google Earth desktop application.
I want to use the Google Maps Api and the Google Earth Api to deliver google earth in the browser.
How can I make this kind of application for myself, what is the best way for doing so?
You should look at the Google Earth Api documentation. http://code.google.com/apis/earth/documentation/reference/
Simple objects like points, polylines and polygons can be created via the api or loaded in Kml format. Take a look at the following documents.
Geometries and Overlays
http://code.google.com/apis/earth/documentation/geometries.html
Introduction to Kml
http://code.google.com/apis/earth/documentation/kml.html
From the sounds of it the KML approach might be the easiest thing - depending on the nature of the application. If you have some existing data in Google Earth, it would be easy to save this as a kml or kmz file and load it in to the Google Earth Api.
Related
I'm trying to find in the Google Maps documentation a way to search for a place and get it's GeoJson polygon but I got no luck finding something like that.
My goal is to create a search bar to search places and then send the geojson polygon to our back-end. I don't want to draw it on a map or anything front-related.
Nominatim is doing exactly what I want but Nominatim policy is very restricted so before I go for an alternative, I wanted to check if Google Maps could provide the same (especially since searching for a country on Google Maps retrieve the polygon and draw it on the map).
Thanks for your help !
Unfortunately Google Maps APIs don't expose any polygons data of geographic features. You can see very old feature request in the Google issue tracker to add this functionality, however it looks like Google didn't set high priority on this task:
https://issuetracker.google.com/issues/35816953
Feel free to star the public feature request to express your interest and subscribe to further updates from Google.
You should get polygons from other sources.
have successfully rendered polygons in google map. I want to save them for offline use.
Is there a way to cache polygons on google map and use them later ?
https://developers.google.com/kml/documentation/kml_tut
Google provides the kml-Format for such glorious things.
The utility at http://www2.warrensburgr6.org/boundary/encoder/#details is good for converting kml files to encoded polylines for use with the Google Maps Javascript API v2. But I notice it no longer works for polygons. So I have two questions:
1) Is there anything equivalent for the Google Maps v3 API?
2) Is it still possible to use encoded polygons with the Google Maps v2 API? If so, how?
And before anyone asks, yes I know it's possible to display kml data directly. But due to the size of the files, I don't want to do so.
Question effectively withdrawn, as I've now managed to hack the encoder utility to produce v3 code.
(I'd still be interested to know whether the v2 API wrapper can be made to display the polygons, but that's really just idle curiosity).
On our website we have several map previews for various KML datasets. When clicking the preview button the link would go to:
http://maps.google.com/maps?q=http://magic.lib.uconn.edu/magic_2/vector/37800/statect_37800_0000_2010_s100_census_1_kml.kmz
which would show a map with the overlaid KML file.
Support for this syntax from Google Maps apparently has stopped working recently, and I cannot find any new information about adding KML layers to a Google Map using the q parameter in a URL. Most of the resources I have found are for JavaScript or embedding maps, which hasn't been helpful. I have also found this thread from StackOverflow (Why has google maps "q" parameter stopped working?) but this is related to a specific location rather than adding a KML file. If anyone has new information or can help, that would be greatly appreciated.
See KML files on Google Maps in the documentation.
From February 2015, maps created in the classic Google Maps — https://maps.google.com/ — will no longer load KML/KMZ files from external websites. However, we know that KML files are a really useful way to work with geographic data, so we’ve added KML to Google My Maps, and continue to support this format with other Google Maps APIs. We hope that one of these options will meet your needs.
There they only list:
Google My Maps
Google Maps JavaScript API
So if you can't use Google My Maps or the Google Maps Javascript API v3, you may be out of luck.
Another reference from "support" is:
KML content isn't available in Google Maps
While using Google Maps, you might have received a notification saying "Some custom on-map content could not be displayed."
That’s because a certain type of content isn’t available anymore in the classic version of Google Maps or in maps embedded on other websites from the classic version of Maps. The content type that’s no longer available is KML, the file format Google Earth uses for the exchange of geographic information.
If you're the owner of a custom map with KML content, you need to update your content. Or, you can import your KML content into My Maps.
hi all
i want to ask about using j2me to program path navigation by using google earth map
i dont found the static map of my country and my city ( iraq - mosul ) so i ask can i take the image from google earth and make a placemarks and draw path between then , i hope i found the answer because i am student researcher to complete my research to get the master
thanks for help me .
hiba
Yes, you can do this in the Google Earth application freely, simply drop the placemarks where you want and draw any linestrings you require.
GE: http://www.google.co.uk/intl/en_uk/earth/index.html
You can save this data as a KML file that can be loaded into most GIS applications including Gooogle Earth and Maps. KML is just and XML file so you could always just put it together by hand in a text editor as well...
KML: http://code.google.com/apis/kml/documentation/
Failing that you could use either the Gooogle Maps or Google Earth api to create the data.
Maps: http://code.google.com/apis/maps/index.html
Earth: http://code.google.com/apis/earth/