I love this extension, it’s exactly what I’ve needed and been looking for.
I am having a small issue pulling out the pin location though. Using the following block of sample code…
The current latitude and longitude of your map is {map_lat} and {map_lng}, respectively. The zoom-level is {map_zoom}.
The current latitude and longitude of your pin is {pin_lat} and {pin_lng}, respectively.I get the following result.
The current latitude and longitude of your map is 40.74750080613109 and -74.00182485580444, respectively. The zoom-level is 16.
The current latitude and longitude of your pin is 40.74750080613109 and -74.00182485580444, respectively.That is to say, the pin_lat/lng vars seem to be overwritten by those of the map. Curious as to why/how this could happen. Or maybe this is normal and to be expected for a centered map 😊
Also weird that when I try to build a link to the larger google map the pin doesn’t appear. Clicking on the google logo in the bottom left corner returns the same result - a large map with no pin. Maybe the maps API is having trouble today…
<a href="http://maps.google.com/maps?ll={map_lat},{map_lng}&spn={pin_lat},{pin_lng}&z={map_zoom}">View a larger map</a> or <a href="http://maps.google.com/maps?ll={map_lat},{map_lng}&spn={pin_lat},{pin_lng}&z={map_zoom}&pw=2">make a print of it.</a>Actually I just checked out Korea in maps.google.com and then maps.google.co.kr and unless I’m doing something woefully wrong the map on maps.google.com gave me a much better zoom resolution than the other site?I can’t speak to your experience, Mark. For us it’s the opposite – the .co.kr site gives us a detailed map, while the .com site gives us no detail at all.
That’s just weird. I wonder why that is though? Perhaps some sort of licensing issue in different countries or something. Seems rather weird though.
Anyway, I would think that the ability to choose the server would be of general interest to international, non-English speaking users. Spanish, French, and German-language speakers, for example, find maps more useful when labelled in their languages even if the detail level is exactly the same.
Yep totally understand that, makes perfect sense.
Best wishes,
Mark
Hi goodcompany,
To answer each of your questions in turn:
That is to say, the pin_lat/lng vars seem to be overwritten by those of the map. Curious as to why/how this could happen. Or maybe this is normal and to be expected for a centered map 😊
Got it in one. If you drag the map off-centre in the Control Panel, and then save it, you’ll notice that the map and pin have different lat / lng values.
Also weird that when I try to build a link to the larger google map the pin doesn’t appear. Clicking on the google logo in the bottom left corner returns the same result - a large map with no pin. Maybe the maps API is having trouble today…
The following should work:
http://maps.google.com/maps?q={pin_lat},{pin_lng}&sll;={pin_lat},{pin_lng}&z={map_zoom}Cheers, Stephen
Thanks, Stephan.
Good answers. But just a quick check for anyone reading this - does this give you a pin? 😊
http://maps.google.com/maps?ll=57.1032107,12.2905275&spn=57.1032107,12.2905275&z=16
I have the pin in my CP and on my site, it’s just not showing up here (for me). Again, maybe a hiccup in the API.
Good answers. But just a quick check for anyone reading this - does this give you a pin?
No, but using those coordinates with the URL structure I previously posted does.
I’m not overly familiar with the structure of the Google Map URLs in truth, and the URL I posted above was discovered by reading this Wiki article, and trial and error.
Stephen
Thanks, Stephan. Good answers. But just a quick check for anyone reading this - does this give you a pin? 😊 http://maps.google.com/maps?ll=57.1032107,12.2905275&spn=57.1032107,12.2905275&z=16 I have the pin in my CP and on my site, it’s just not showing up here (for me). Again, maybe a hiccup in the API.
If you change
maps?ll=to
maps?q=the pin shows.
Hey all, I think I solved my problem. Here’s how I generate Google map links with custom pin locations, using the SL Google Map Extension.
http://maps.google.com/maps?q=(Crestview Apartments)+1001 North Pleasant [email protected],-72.53328323364258&zoom=16According to the Wiki article cited earlier: http://mapki.com/wiki/Google_Map_Parameters * Putting parentheses around something in the query (q=…) makes it show up in the browser title bar and elsewhere. * Using the @ sign followed by {pin_lat},{pin_lng} allows you to create arbitrary pin locations. Why is this important? Because sometimes Google maps are WRONG. My client noticed that some of their apartments were showing up blocks away from where they are physically located.
I may write an article on this for EE Developer. If so, I will post back.
I’ve posted an article detailing how to do this.
http://ee-developer.com/home/articles/creating-custom-google-maps-in-expressionengine-entries/
Interesting stuff, thanks for putting together the article expdesign.
It’s annoying that the Google Map locations are occasionally wide of the mark. It’s a known issue on the UK maps when searching for a postcode, because Google doesn’t have full access to the UK postcode database, but thankfully I was able to implement a decent workaround.
Anyway, I’m glad you finally got everything sorted.
Cheers, Stephen
{google-map}
{locatie-wereld-beluister}
This is the fallback content for users who cannot see the Google Map.
The current latitude and longitude of your map is {map_lat} and {map_lng}, respectively. The zoom-level is {map_zoom}.
The current latitude and longitude of your pin is {pin_lat} and {pin_lng}, respectively.
{/locatie-wereld-beluister}
{/google-map}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.