Michael
Michael

Reputation: 29

Adding data from google my-places map to customized google map

I made a customized google map with javascript: http://resortstudio.ch/kontakt/

I would like to directly add (import) many markers from a personal google-my-places-map. From something similar to this example: http://goo.gl/maps/0uRg

In other words. I want to import the data from a saved, personal map on google-maps into my custom-styled map. Is there an easy way of importing those places/markers without having to write every location in code into my custom map?

Upvotes: 0

Views: 1606

Answers (1)

geocodezip
geocodezip

Reputation: 161384

You can use KmlLayer in the google maps API v3 to import KML. There is a KML version of that map available .

Here is an example that displays the example you provided using the API v3

You asked:

  1. Is there a way, to directly link to the KML-File on google maps instead of download/put the KML file on a server by myself?
  • The example above uses a link directly to the kml file stored on Google's servers.
  1. When I load the KML-Layer, it ignores my defined "center" of the map. Same happens in your example above, where the "center" is set to Chicago, but is overwritten by the KML (NYC). Any way to overwrite the KML-center-setting?

You can download the KML mentioned above by clicking on the KML Link from your saved maps, see the image below and notice the last link (KML).

enter image description here

Upvotes: 4

Related Questions