New Google Maps embedding option - google-maps

Since the latest Google Maps update in 2013, is there a way or a resource that can be used for simple embedding Google Maps?
I have tried using the old maps system but it does not produce desired results.
Also, I have tried using Google Maps Engine, no luck there as well, because you are only served with a link to share, not embed code.

After extensive research on the topic I found no simple way of embedding new Google Maps. Problem will possibly go away once Google decides to update Google Maps. However, I have not seen Google Maps development roadmap and so I can't really vouch for them.
Apart from using simple solution, there are two others (not so simple of course) that might provide a decent substitution.
Solution 1
Using Google Maps API where you can find Developer guides, API reference and code samples. There is no easy way about this, simply follow the instructions and review examples that Google has supplied. Hopefully there might be something in it that will help you.
Simple guide to Google Maps API
Solution 2
Using Google Maps Engine will offer you a way to create your own map. Once you have created a map, added pins, points, routes, etc. at the end you can select option to share. However, option to share just allows you to share a link, not embed. I just wanted to point out this "feature", if you will, of the system.
To embed a map you have to click on a folder in the upper left corner. Shown on the image below and select Embed on my site option.

In the bottom right corner of the map you'll see a cogwheel. Click it.
Click on "Share and embed map";
Choose the size you need from the drop-down menu or choose the custom option;
Click in the box to the right that starts with <iframe src="https://www.google The code should be highlighted. copy and paste it into your web page or blog.
Simples!

Related

Google maps with directions on a wordpress page

How can I get a map that simply shows how to get from A to B with a car on my WordPress page?
I used to do this in Google maps directly, I made a map showing the road from A to B and embed it on the page. It used to be so easy. And under the map I had a link to the same map in Google Maps where you also could get written directions. But like a month ago, Google changed their maps and all my maps got messed up. The links as well. Now I am trying to fix this and make new maps.
I have tried in Google maps directly like i used to do, and this is the closest I get to what I am looking for: https://developers.google.com/maps/documentation/embed/start. But I find that very hard to customize, because there are very few options. I have also tried a lot of different plugins, but so far no luck.
Is there a better way to do this?
If you want to customize the map, I can only strongly recommend you the Google Maps API. Here is a good example of how to integrate the directions service into a map and display it on your web page.

How to make links to the new Google Maps, with coordinates

Google recently changed Google Maps UI, and now the links I use does not work anymore.
I've tried searching, but I haven't been able to find info om how i should build links to the new Google Maps. I only find info on integration, and static image maps, which still works, but I want to be able to click on the image to get to the full Google Maps.
This is the format I used earlier:
https://maps.google.com/maps?z=16&t=h&q=loc:48.854013+2.350232
Does anyone know how I can get that work again, or preferably, a link to the entire documentation?
Here is the API for Google Maps Embed API
check the new link structure.
https://www.google.com/maps/embed/v1/view
?key=API_KEY
&center=37.4218,-122.0840
&zoom=18
&maptype=satellite

Mark a place on Google Map and embed widget

http://snag.gy/mHDah.jpg
Please look at the above picture.
I want to add a place to the map and export embed html widget to my web site.
But the problem is a place is not there. (Not body added that place to Google Map).
I want to mark that place with a red point in a embed map. (Please look at the below snapshot)
http://snag.gy/7DFm3.jpg
Please help me.
Maps Engine Lite (Beta) is a tool which allows you to design and save your own custom maps. In order to make use of it, you'll need to have a Google account and be logged in.
For example, have you tried to embed a newer Google map into a web
page? The reliable old "link" button is nowhere to be found!
A simple example is here
Those pins are called markers in the gmaps API.
This example does what you want: https://developers.google.com/maps/documentation/javascript/examples/marker-simple
You can use normal Google maps to find out the coordinates for your place by right-clicking on it and choosing "what's here" (works in chrome and safari at least).

Use a URL to link to a Google map with a marker on it

I want to link to google maps at a particular location with a marker on a particular point.
It's easy to link to a location:
http://maps.google.com/?ll=XX.XXXX,XX.XXXX
But how do I drop a marker at that point too? preferably with a bit of my own text but that's just a bonus.
2017 - Google has released documentation on this see new accepted answer: https://stackoverflow.com/a/44477650/359135
In May 2017 Google launched the official Google Maps URLs documentation. The Google Maps URLs introduces universal cross-platform syntax that you can use in your applications.
Have a look at the following document:
https://developers.google.com/maps/documentation/urls/guide
You can use URLs in search, directions, map and street view modes.
For example, to show the marker at specified position you can use the following URL:
https://www.google.com/maps/search/?api=1&query=36.26577,-92.54324
For further details please read aforementioned documentation.
You can also file feature requests for this API in Google issue tracker.
This format works, but it doesn't seem to be an official way of doing so
http://maps.google.com/maps?q=loc:36.26577,-92.54324
Also you may want to take a look at this. They have a few answers and seem to indicate that this is the new method:
http://maps.google.com/maps?&z=10&q=36.26577+-92.54324&ll=36.26577+-92.54324
If you want to include a zoom level, you can use this format:
https://www.google.com/maps/place/40.7028722+-73.9868281/#40.7028722,-73.9868281,15z
will redirect to this link (per 2017.09.21)
https://www.google.com/maps/place/40%C2%B042'10.3%22N+73%C2%B059'12.6%22W/#40.7028722,-73.9868281,15z/data=!4m5!3m4!1s0x0:0x0!8m2!3d40.7028722!4d-73.9868281
This URL format worked like a charm:
http://maps.google.com/maps?&z={INSERT_MAP_ZOOM}&mrt={INSERT_TYPE_OF_SEARCH}&t={INSERT_MAP_TYPE}&q={INSERT_MAP_LAT_COORDINATES}+{INSERT_MAP_LONG_COORDINATES}
Example for Mount Everest:
http://maps.google.com/maps?&z=15&mrt=yp&t=k&q=27.9879012+86.9253141
Full reference here:
https://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters
-- EDIT --
Apparently the zoom parameter stopped working, here's the updated format.
Format
https://www.google.com/maps/#?api=1&map_action=map&basemap=satellite&center={LAT},{LONG}&zoom={ZOOM}
Example
https://www.google.com/maps/#?api=1&map_action=map&basemap=satellite&center=27.9879012,86.9253141&zoom=14
If working with Basic4Android and looking for an easy fix to the problem, try this it works both Google maps and Openstreet even though OSM creates a bit of a messy result and thanx to [yndolok] for the google marker
GooglemLoc="https://www.google.com/maps/place/"&[Latitude]&"+"&[Longitude]&"/#"&[Latitude]&","&[Longitude]&",15z"
GooglemRute="https://www.google.co.ls/maps/dir/"&[FrmLatt]&","&[FrmLong]&"/"&[ToLatt]&","&[FrmLong]&"/#"&[ScreenX]&","&[ScreenY]&",14z/data=!3m1!4b1!4m2!4m1!3e0?hl=en" 'route ?hl=en
OpenStreetLoc="https://www.openstreetmap.org/#map=16/"&[Latitude]&"/"&[Longitude]&"&layers=N"
OpenStreetRute="https://www.openstreetmap.org/directions?engine=osrm_car&route="&[FrmLatt]&"%2C"&[FrmLong]&"%3B"&[ToLatt]&"%2C"&[ToLong]&"#Map=15/"&[ScreenX]&"/"&[Screeny]&"&layers=N"
2023 update:
I found a very easy way to implement this function.
From google maps, find your POI (point of interest) and click on it.
on left handside opening menu you will see an icon Share and click.
A modal opens and you see a sharing link input box. Next to it you will see Copy link. Go to your url and paste it like;
Drive to our office
Voila, you are done.

Do i need use google maps api only to embed litle map with route calculator/display for only one destination?

Well i want to upgrade contact page with dynamic map showing location and give oportunity to calculate route for comapny headquatters. Id it necessery for such simple task use Google api? i mean here generating akey etc? Fo i have any other alternatives to google maps?
There's really no reason to mess with the API at all unless you need to customize the appearance or behavior of gmaps. Why not just use an iframe with a url of:
http://maps.google.com/?q=[you-url-encoded-address-here]
or better yet, set up a textbox and a 'get directions' button to redirect that frame to:
http://maps.google.com/maps?saddr=[their-address]&daddr=[your-address]
edit: this works well in modal dialog if you don't want the google logo sticking out like a sore thumb in your pageflow
You could probably embed directly with a specific URL that will configure it to have the destination you want.
By the way, well written answers are much more likely to receive useful responses here.
You could consider http://www.openlayers.org/ as an alternative to google maps.
In fact open layers can be used to add a Google map, or an OpenStreetMap map or a Bing map, etc.