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

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.

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!

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.

Related

Google Maps - Multiple Markers via URL only

If I want to open a browser to Google Maps to center and show a single marker, I do it with a URL like this:
https://www.google.com/maps/place//#33.91729,-106.85761,10z/data=!4m2!3m1!1s0x0:0x0
But, I have 5-10 lat/long pairs that I want to show on that same map. How can I show multiple lat/long markers all specified only in a URL?
There is an up-to-date article (updated: May 18 2017) about easily linking to locations and directions using the New Google Maps.
You could use the directions service and form a url as such:
https://www.google.com/maps/dir/33.93729,-106.85761/33.91629,-106.866761/33.98729,-106.85861
Use double slash "//" between markers to leave a position empty e.g. to set a custom start point.
Update
There is another excellent article here
Well, it is possible without directions. just add at the end: //# . example:
https://www.google.com/maps/dir/33.93729,-106.85761/33.91629,-106.866761/33.98729,-106.85861//#34.0593359,-106.7131944,11z
I just wanted to add that Yandex.Maps does offer this feature without an api key. The syntax is pretty simple: https://yandex.ru/maps/?ll=[center longitude],[center latitude]&pt=[longitude1],[latitude1]~[longitude2],[latitude2]&z=[zoom level]&l=map
Eg:
https://yandex.ru/maps/?ll=30.310182,59.951059&pt=30.335429,59.944869~30.34127,59.89173&z=12&l=map

google maps link

I want to place a link on my website that links to google maps,
however I can't find information on how to form the url.
I have lat and lng coordinates and I want a marker to show the exact point.
I have this for example
http://maps.google.co.uk/maps?hl=en&ll=55.236865,-1.616422&z=15
but it shows no marker
This can be done even easier now: https://google.com/maps/place/55.236861,-1.616417
http://maps.google.com/maps?f=q&hl=en&q=Via+Celadina,+4,+24125+Bergamo+Bergamo,+Lombardy,+Italy&sll=6.315299,14.414063&sspn=123.405342,329.0625&ie=UTF8&cd=1&geocode=0,45.688764,9.709610&ll=45.689094,9.709618&spn=0.00676,0.020084&t=h&z=16&iwloc=addr
And also
http://asnsblues.blogspot.com/2011/11/google-maps-query-string-parameters.html/
Stack:
Google maps URL. I want to create a URL to google maps. I want to show search near specific coordonates
all the googlemap api are define here
http://maps.google.co.uk/maps?hl=en&ll=55.236865,-1.616422&z=15&q=#55.236865,-1.616422

Max url length with Google Maps static image

I need to create a static image of google map with several markers, and each marker has a custom icon.
In the Api DOC there is the note: Static Map URLs are restricted to 2048 characters in size. In practice, you will probably not have need for URLs longer than this, unless you produce complicated maps with a high number of markers and paths.
The url is very long.... There is the position for each marker and the URL for the custom icon for each one.
I've already tried with POST request ma it is not supported.
There is another way to create a static map image without max length limitation?
A possible way might be this, but i don't know if is it possible: I've create my custom map using the function in GMaps, and i have added all the markers i need.
There is a way to access in static way to this particular map? so in the url i have to give only the center of the map and other parameters (zoom, ...), but all the markers are already positioned.
Or... another idea... Can i submit the URL of a KML with all markers positioned instead each single marker position+icon url?
FYI, Google recently updated the limit to 8192.
Have you tried using a URL shortener for the icon urls? I believe the static map API will respect services that make URLs shorter... might save you a few characters.
You might wanna check out toopola´s API to help working with Google Static Maps, I am about to make my own attempt.
Another idea
find map area that contains all the markers
divide the map area into rectangular pieces (4 pieces for example)
create image url for each part, but include in url only markers and icons visible on map
show images
Мethod of division depends on the markers position.
Yes, you can definitely do this with the Javascript API.
I have built a few applications using that API. It can be a little tricky to get your head around, but it is pretty good. For what you want to do, it would not be too difficult. If the user has to be able to interact with the map and add pins and such, it starts to get a little more complicated because you have to capture clicks and such.
Does the map its self need to be available as a URL, or does it just need to be embedded on some page and that URL can be used?
The Javascript API will work best if you can embed the map into an existing webpage.

google maps: use directly on google server?

Usually u have to set up a little script + htmlpage on your server to run google maps,
but i was wondering - is it possible to use google maps directly?
i mean by just calling an url with parameters (gpoint coordinates, zoomfactor ..) and it loads the map fullscreen without having to use my own server?
Sounds like you might be after the static maps api. You can build a URL specifying the properties of the map like:
zoom
position
markers (including custom markers)
image size
etc
and you will get back a rendered image of the map. Something like:
Obviously this just gives you a fixed image of the map you are after. If you need a dynamic Google map, then you will need to use the Google Maps Javascript API.
Not hosted by Google. You might find some other website that uses the API to do the same thing.
Google Maps API

How to use map created from MyMap into our application?

I am creating a custom map into MyMap link on google map for creating our own map with adding various placemark points &/or lines.
see http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=
113225627012396411583.000478b8658fde4ac307b
Can I use the url getting from crated map into our application to show it programmatically with adding some points through application with javascript instead of using following url:
http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAcl
Regards,
Girish
One thing you can do is go to the MyMap and grab the URL from the "View in Google Earth" link on the bar at the top of the map.
Then you can use that URL in a GGeoXml call in the Google Maps API.
Another thing you can do is go to the MyMAp and click the "Link" link on the bar at the top of the map. If you feel like it, use the "Customize and preview embedded map" option. Then grab the displayed HTML and paste it into your website.
In both those cases the data is dynamic. Future changes to the MyMap will be reflected on your website, after a few hours delay due to caching on the Google server.
If you want more control, then you'd need to consider third party extensions to the Google Maps API, such as EGeoXml, GeoXml or GeoXml3. In which case the data would normally be static and not reflect future changes to the MyMap, but you could write your own server-side code to refresh it.