exporting shape data from my maps for use in API

1,130 views
Skip to first unread message

mheavers

unread,
Jun 21, 2010, 6:09:39 PM6/21/10
to Google Maps JavaScript API v3
Hi - I have a series of complex polygonal overlays I've made on a
basic google map (saved in my maps) - is there a way to export this
shape data for use in the javascript API? Or a way to utilize the API
to draw a shape and get its plot points rather than plot each
individual point by lat & long?

geoco...@gmail.com

unread,
Jun 21, 2010, 7:03:10 PM6/21/10
to Google Maps JavaScript API v3
You can export the kml from Google MyMaps (View in Google Earth), then
load that (or use it directly from MyMaps) and display it on an API
based map.

-- Larry

mheavers

unread,
Jun 22, 2010, 12:12:25 PM6/22/10
to Google Maps JavaScript API v3
Yes - I tried this - but the KML did not seem to include any sort of
information about the shape data. It seems like Google stores the
shape data all within the href node or something.

On Jun 21, 7:03 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:

geoco...@gmail.com

unread,
Jun 22, 2010, 12:40:24 PM6/22/10
to Google Maps JavaScript API v3
On Jun 22, 9:12 am, mheavers <mheav...@gmail.com> wrote:
> Yes - I tried this - but the KML did not seem to include any sort of
> information about the shape data. It seems like Google stores the
> shape data all within the href node or something.

It worked for me. I had to go through one level of indirection to get
there:
This was exported from MyMaps:
http://www.geocodezip.com/Directions2SeaWorld.xml

http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=101196690680661628506.000489924544a5a17a203&z=15

-- Larry

>
> On Jun 21, 7:03 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> wrote:
>
>
>
> > On Jun 21, 3:09 pm, mheavers <mheav...@gmail.com> wrote:
>
> > > Hi - I have a series of complex polygonal overlays I've made on a
> > > basic google map (saved in my maps) - is there a way to export this
> > > shape data for use in the javascript API? Or a way to utilize the API
> > > to draw a shape and get its plot points rather than plot each
> > > individual point by lat & long?
>
> > You can export the kml from Google MyMaps (View in Google Earth), then
> > load that (or use it directly from MyMaps) and display it on an API
> > based map.
>
> >   -- Larry- Hide quoted text -
>
> - Show quoted text -

geoco...@gmail.com

unread,
Jun 22, 2010, 1:16:45 PM6/22/10
to Google Maps JavaScript API v3
On Jun 22, 9:40 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Jun 22, 9:12 am, mheavers <mheav...@gmail.com> wrote:
>
> > Yes - I tried this - but the KML did not seem to include any sort of
> > information about the shape data. It seems like Google stores the
> > shape data all within the href node or something.
>
> It worked for me.  I had to go through one level of indirection to get
> there:
> This was exported from MyMaps:http://www.geocodezip.com/Directions2SeaWorld.xml
>
> http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=1011966906806...

The kml from MyMaps is here:
http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=101196690680661628506.000489924544a5a17a203&output=kml
(inside the <href> element in the first level kml that "View in Google
Earth" returns)

  -- Larry

>
>
>
>
> > On Jun 21, 7:03 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> > wrote:
>
> > > On Jun 21, 3:09 pm, mheavers <mheav...@gmail.com> wrote:
>
> > > > Hi - I have a series of complex polygonal overlays I've made on a
> > > > basic google map (saved in my maps) - is there a way to export this
> > > > shape data for use in the javascript API? Or a way to utilize the API
> > > > to draw a shape and get its plot points rather than plot each
> > > > individual point by lat & long?
>
> > > You can export the kml from Google MyMaps (View in Google Earth), then
> > > load that (or use it directly from MyMaps) and display it on an API
> > > based map.
>
> > >   -- Larry- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

VelkyKorys

unread,
Feb 24, 2011, 5:04:14 PM2/24/11
to google-map...@googlegroups.com
I am trying to do the same but I still cannot see the data in the KML file. I have a set of polylines in My Maps which I would like to be able to work with using API. I have exported the map to Google Earth and then to KML. So what shoud I do now?

geoco...@gmail.com

unread,
Feb 24, 2011, 5:21:56 PM2/24/11
to Google Maps JavaScript API v3
You could either take the kml file you got out of Google Earth and put
it on a public server or use the kml output from your MyMaps (assuming
it is public). If you post a link to your MyMap, we can give more
specific advice on how to link to it (other than click on RSS, change
the output=georss to output=kml, and use that URL as the argument to
KmlLayer).

-- Larry
Reply all
Reply to author
Forward
0 new messages