How to use map created from MyMap into our application? - google-maps

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.

Related

Embed mymaps on website with possibility to see current position on mobile

I want to embed "my maps" to my website using iframe, but I want to let my clients to open that map in a new window and see their location on it.
If I open my map in edit mode on my phone: www.google.com/maps/d/edit?mid=*** I see my position, if I change the mode to "view" it stops tracking my location.
Is there a way to open the big map and to see the current position? It's very useful... Maybe there is another way to embed it...
Based on the documentation
url: https://developers.google.com/maps/documentation/staticmaps/intro?hl=en
it seems that it is not possible to get the current location (position of the client) using the parameters which go along with the url. This means that you can not use iframe and embed google maps inside it to get your current position.
However, you can still use geolocation and program it to get the user current position on the map,
url (code included in the link): https://developers.google.com/maps/documentation/javascript/examples/map-geolocation
Bare in mind that the google map API will always ask you the permission to access data in order to locate you.

How to hyperlink to a location in an embedded map

I am creating a blog and have created a public google map with "my places". This map contains several relevant locations to the blog posts. I would like to include a link in each post to the location on the embedded map in another page on the blog. How is this possible? Or this there a better method?
Thanks!
When viewing the location in Google Maps, just copy the value given when you press the LINK button.
If you are rendering the map (and the markers) on your own page you can use a hash url technique.
http://mysite.com/map#loc_3
When the page loads, use JavaScript to look at document.location.hash, grab the value, then fire the event to go to that marker.

Embeded google street view

Is it possible to have a google map embeded street view panorama of a given address in your page?
All the codes I have came across work with coordination, I'm looking for "address", since if you just use coordination you will have to set pov and all that,
Google seems to do that itself, look at the panorama picture here:
http://maps.google.ca/maps/place?hl=en&sugexp=kjrmc&cp=10&gs_id=z&xhr=t&biw=1680&bih=874&gs_upl=&bav=on.2,or.r_gc.r_pw.,cf.osb&um=1&ie=UTF-8&q=toyota+calgary&fb=1&gl=ca&hq=toyota&hnear=0x537170039f843fd5:0x266d3bb1b652b63a,Calgary,+AB&cid=16440335169618939517&ei=VpqYTpPsLbCrsALi0LnqBA&sa=X&oi=local_result&ct=map-marker-link&resnum=1&sqi=2&ved=0CF8QrwswAA
Thanks
Yes, using the Google Maps Javascript API V3. Take a look here: http://code.google.com/apis/maps/documentation/javascript/services.html#StreetView
You can also embed Street View on your page by just using Google Maps.
Search for the address on Google Maps.
Go to the Street View for the location.
Click the link button in the upper-right hand corner above the map.
Click the 'Customize and preview embedded map' link.
A new page will open up with some customization opens and the code to embed the map/image on your page.
Yes you can. All you need is a google decoder who will decode your address. Another way is to directly pass your address as a part of the url to google.
When using decoder, you will get the result in the form of a latitude longitude object which you can use to reset/set your map's marker
There is no way to accurately set the heading automatically and no way to set the pitch and fov (field of view) - BUT if you figure these out manually you can create a URL that fetches a static image with those settings from Google
Take a look at this tutorial on the Street View Image API

Custom placemarks directly on maps.google.com for my map

I made a custom map with a couple of placemarks on it. I have copied html code and pasted it into my web page. Everything works fine. The map and placemarks are displayed correctly.
And when I press the bottom left corner button "Click to see this area on Google Maps" I can see my map directly on maps.google.com but the placemarks disappear.
Is it possible to show the placemarks on my map right on the maps.google.com? or can I manage placemarks for my custom map directly on maps.google.com using API?
I think the closest thing to what you are after is MyMaps. My maps lets you create map content ( or import KML, KMZ, or GeoRSS files), on maps.google.com. I think you can programaticaly create maps via the Google Data API.
I am not sure what your requirement is, but if your content is static you could create a MyMap up front and then load that url rather than maps.google.com.
Here is the example of what i need -)
We send request to maps.google.com to show some area (sending latitude, longtitude, zoom) and then we specify the placemarks we want, not by hand (using MyMaps) but using API. And we need to do it directly on the maps.google.com, not on my own site or home page with embeded or even programm builded map.
Thanks to Cannonade. The links you've shared helps me a lot -)

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

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.