Embed google map using longitude and latitude - google-maps

I would like to embed Google Map into my website, and I'm passing over 2 parameters, "longtitude" and "latitude".
Any possible way the map will change according to the longitude and latitude I sent in?
For example, I put in
3.1019924,101.4804983 and click on "Search map" on maps.google.com
I will get the location and the embed code.
How can I do it in a way I have already embed the map, just passing in the data?

You need to use the Google API. http://code.google.com/apis/maps/documentation/javascript/

Sounds like you already have the Google Maps javascript Google Maps object in your page, so you just need to center the map given a location.
To do this you need to call the panTo method on your google.maps.Map object. You pass a google.maps.LatLng object as a parameter and it will center the map on that location:
yourMap.panTo(new google.maps.LatLng(lat, lng));

Related

How to add a custom path to google maps and use it with directions api?

I want to use the google maps javascript API for my project. I am using directions API to show path between two places on the map. My problem is since this app is focusing on a very rural area all the paths in the area still not in the google maps. Can I include those new paths to my instance of google maps and use the directions API to navigate through the paths? How can I do this? Is there a way to add a path to map as a polyline and use it for directions?
Update:
here is a screenshot of the application I was developing.
The white color path, works with directions api. I draw a polygon with coordinates I know of the unknown path, I want to use that path with directions api to show directions.

Google Maps Places API, need to get same markers as on Google emded

Good day !
I'm developing custom service, that will grab params form Google Maps url, like https://www.google.nl/maps/search/fietsenmaker/#52.1285737,5.0837216,13z/data=!3m1!4b1?hl=en. From this example it's possible to take search param, longitude, latitude and zoom level. All this params will pass to Google Places API and markers will be drawn on Google map. The main problem, i can't get this markers look same as on embed Google Maps. Here is attachment:
In simple words:
Need to dynamically embed map with listing of places, that was originally in search param and place map center according lat/long with original markers as on embed map.
Any ideas ?
Thanks !
Google Embed API will allow you to embed maps with starting params, like map center, object name. You can find it here https://developers.google.com/maps/documentation/embed/guide
Good luck everybody !

Google Maps - Link from static image with markers to full maps.google.com

I need to redirect from a static google maps image via the Static Maps API to maps.google.com.
I have multiple markers on the map. Example: "http://maps.googleapis.com/maps/api/staticmap?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862"
I need the proper url format that, when the image is clicked, will redirect to maps.google.com with all markers placed on the map. I cant find the documentation on how to do this.
There are no way to add markers into the google maps now.. so the answer is no.
However, you can build a custom page, which uses the google maps API and you can add markers that way.
I built a sample page here in github.
so for your map:
you can wrap it with an a element which link to your page with the same option like this sample:
http://kylelam.github.io/SO/customMarkers.html?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862

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

Place markers through search in Google maps API (static)

I am currently working with the Google Maps API and returning static maps (images) from the API.
I need to place markers on the map. The documentation says how to place markers on the map by defining long/lat values: http://code.google.com/apis/maps/documentation/staticmaps/#Markers
My problem is that i donĀ“t know where to place the markers. I want a google maps search phrase to determine the placement of the markers. Is that possible?
To sum up:
I want to submit a search phrase to the API and have a static map (image) returned with markers matching my search phrase.
You can place markers based on an address:
http://maps.google.com/maps/api/staticmap?center=55.665149742004,12.5627200816055&zoom=12&size=640x640&sensor=false&maptype=hybrid&markers=color:blue|label:S|smallegade%201,%20frederiksberg
Yes, it's possible. Try this:
http://code.google.com/intl/pl/apis/maps/documentation/geocoding/
This particular link regards to Maps API Web Services, but there are others api, for javascript for instance.
Generaly you need Geocoging that tranlate address to latitude and longitude
I believe you can not search a term in Maps Static version. It is not in the accepted parameters: https://developers.google.com/maps/documentation/maps-static/dev-guide#Usage
Try using Embed or JavaScript versions instead.