0

I'm wondering if it is possible to insert a map (with some lines) that was created on google.com into a javascript that uses the v3 api. I tried to read it up/google it, but I couldn't find anything so I'm guessing it isn't possible?

If yes, - how?

SHDY
  • 33
  • 1
  • 4

2 Answers2

0

I think ImageMapType is good for you. https://developers.google.com/maps/documentation/javascript/reference#ImageMapType

wf9a5m75
  • 6,100
  • 3
  • 25
  • 59
0

If you are talking about a map created in "My Places" on maps.google.com, those can be accessed as KML which can be displayed on a Google Maps API v3 map using KmlLayer

Map created in "My Places"

Same KML displayed on a Google Maps API v3 map with KmlLayer

To answer your additional question in the comments, the simplest way to do it is to take the example from the documentation and replace the URL with yours. So yes, you can just change the filename URL in the first line of the initialize function to the URL of your KML:

function initialize() {
  filename = 'http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml'; 
geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • Exactly that. I'll look into that and hope I can get it running. Thanks! – SHDY Nov 15 '12 at 23:46
  • Did that by mistake and changed it before reading your reply. Cheers & sorry. – SHDY Nov 16 '12 at 00:17
  • Can you help me a little more? I understand how to overwrite the code by changing the second url that you posted so it links to my KmlLayer, but I don't understand how I integrate my Kml Google Link inside that example script. Can I not just change the cta.kml to my URL? Do I need to set all the other parameters? – SHDY Nov 16 '12 at 00:34
  • Updated my answer. Yes, you can just change that or replace "filename" in the constructor for KmlLayer. – geocodezip Nov 16 '12 at 00:46