23

I know I can do it with the Google Maps API, but do you know if there is a way to change the marker in an embedded Google Map?

I want to replace the default "A" button for a "B" button or the marker with just a dot in the middle.

Kara
  • 6,115
  • 16
  • 50
  • 57
ana
  • 1,565
  • 4
  • 17
  • 22
  • Are you wanting to create a custom icon? Also check here for great Google Map API References: http://code.google.com/apis/ajax/playground/ – Petrogad Jul 24 '09 at 04:13
  • 1
    no, just change the default icon for other of the Google Maps icons. I tought perhaps you can add a parameter to the iframe URL to specify the marker. – ana Jul 24 '09 at 04:38

2 Answers2

32

I haven't played around with embedding Google Maps before (I generally go straight to the API for stuff like this). I tried a couple of approaches:

  • I figured maybe the embed syntax would be the same as the static maps api. So I grabbed a static maps URL, copied the markers param from that and tried sticking it into the iFrame URL. This didn't work so much.

  • I created a Google MyPlaces and customized the marker to use the one your provided. This created a Test map which had the appropriate marker icon. I then grabbed the embed code and stuck it on a test page and voila!

RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
5

Actually I had the same problem but didn't use any of the methods above and thought I share:

If you only want a marker as I did but don't want to use API then simply fool google into thinking you want a route planned using the GET tags "saddr" and "daddr"

"saddr" defines your start location (post code , street name+ number, whatever)

ONLY define saddr and leave out daddr and google maps will by default still show the marker for "A" (your start location) exactly where you want it , all in iframe without API.

John Conde
  • 217,595
  • 99
  • 455
  • 496
FaTe
  • 155
  • 3
  • 11
  • 1
    How does this create the custom marker option for iframe maps? I you just want a Google marker on the desired location, this is not the way to go. Go to maps and search address, then click on share to create a map for that location (with marker and other usefull links like direction). This is an old answer, maybe this feature wasn't available then? – Bjorn Sep 05 '18 at 00:30
  • 1
    at the time no, life has gotten easier for this over the years :) – FaTe Jun 24 '20 at 12:17