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=16
According 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}
Hi Johan,
{locatie-wereld-beluister} is the map field
As per the docs, the code you need is something like this:
{exp:weblog:entries weblog="your-weblog-name"}
{locatie-wereld-beluister id="example-map" class="map" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
{map}
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.
{/map}
{/locatie-wereld-beluister}
{/exp:weblog:entries}
Hope that clarifies matter.
Cheers, Stephen
Hi Stephen,
Some thoughts now I’ve used it -
Is there a way to use multiple maps on one page? I try to do this -
{franchise_googlemap id="map_{entry_id}" class="googlemap" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
But the output comes out like this -
<div id="field_id_42_container" class="sl-google-map">" class="googlemap" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
I’m also getting the following errors at the top of the template -
Notice: Undefined offset: 4 in /home/tuscan/public_html/tennisexcellence/admin/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 464
Notice: Undefined offset: 3 in /home/tuscan/public_html/tennisexcellence/admin/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 464
Notice: Undefined offset: 2 in /home/tuscan/public_html/tennisexcellence/admin/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 464
Notice: Undefined offset: 1 in /home/tuscan/public_html/tennisexcellence/admin/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 464
Hi Steven,
Apologies for the delay in responding to this, work is very busy at the moment.
Is there a way to use multiple maps on one page? I try to do this…
This is probably a parse-order problem. Placing the Google Map in an embedded template, and passing in the ID, would be a better bet.
As to the other template errors, let me know if they don’t go away once the other problem is addressed, and I’ll look into it.
Also, thanks for the suggestions. You’re not the first person to mention support for localised servers, so I’ll have to find out what (if any) difference that would make.
Cheers, Stephen
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.