Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change the marker in a Google Maps embedded map (iframe)?

Tags:

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.

like image 813
ana Avatar asked Jul 24 '09 04:07

ana


People also ask

Can you change markers on Google Maps?

To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.

How do you customize a marker in maps?

For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.


2 Answers

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!

like image 78
RedBlueThing Avatar answered Oct 13 '22 00:10

RedBlueThing


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.

like image 25
FaTe Avatar answered Oct 13 '22 01:10

FaTe