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.
Related
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
I have found location on google map and get custom iframe code with marked location. However marker always disappears from map after several days.
Here is our website about page: http://witcraft.ru/about. Location of our office was marked, but now the marker has disappeared.
Also we have same issue on other websites. How can I avoid this behavior?
Regards,
Alexey Zakharov.
Looks like the only way to ensure that marker won't disappear is to use company website name during the query.
So if you want to mark your company that has your-company.com domain you should search it on google maps and when grab embeded code. Keep in mind that your-comapany.com domain should be mentioned in company description that you send to Google Places service.
I currently have a map mashup that has locations that I'm populating from my own database. A few users would like to also show that map on their site(s). I'd like to give them the ability to do that, but would like to retain the actual functionality of the map on my own site: like add "stuff" to places on the map through my a web form on my site. I could open the entire API to allow them to create their own form along with the data points, but most of the people wanting to put up the map aren't developers, they are just enthusiasts that have put together a personal page that they want to spice up.
I was thinking I could just provide a JavaScript of some kind that they could then take to place on their site, or maybe an IFRAME of some type, or...any ideas? Anyone implemented this? TIA.
I haven't done anything like this myself, but I think your idea to utilise an iframe is on the right track. In fact, this is how Google Maps generates its embed code.
Your app will need to generate a URL with all relevant Google Map parameters such as bounds, zoom level as well as your application-specific params. Any event that triggers the map to re-draw (drag, zoom, etc.) will generate a new URL.
If you try the embed link in Google Maps as an example, it generates a URL that looks something like this:
http://maps.google.com/maps?f=q&source=s_q&sll=45.434035,12.339057&sspn=0.003294,0.004812&ie=UTF8&ll=45.432724,12.338966&spn=0.006588,0.009624&t=h&z=17
This URL can then be wrapped up in an iframe which your end users can place on their web pages.
Re: resizing
Yes, it's possible to dynamically resize it if width/height is part of your application params that generates the embed code. Again using Google Maps as an example:
<iframe
src="http://maps.google.com/maps?f=q&source=s_q&sll=45.434035,12.339057&sspn=0.003294,0.004812&ie=UTF8&ll=45.432724,12.338966&spn=0.006588,0.009624&t=h&z=17&output=embed"
width="(width-param)" height="(height-param)"></iframe>
If you mean resized by user, after it's been displayed, I'm not sure.. most likely, yes.
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.
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.