We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SL Google Map Field Type : Google Maps in your CP, SAEFs, and EE templates : Now with map types in the CP

Development and Programming

Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
I tried setting the ID parameter using {entry_id} to differentiate, but that jumbles up the output

Looks like a parsing order issue, where EE is parsing the Google Map before the entry_id. I’ll have to do some digging, see if I can find a solution.

Stephen

       
Brendon Carr's avatar
Brendon Carr
135 posts
16 years ago
Brendon Carr's avatar Brendon Carr

Stephen, here’s a feature request: International Google service support. There are some (paranoid and stupid) countries which forbid a map provider from exporting map data to a server located outside the borders of the country. I happen to know there are two of them – Korea and China – through my work. Both countries’ maps available through the maps.google.com server are bereft of detail. Yet if you go to maps.google.co.kr or maps.google.cn, respectively, very rich maps are available. An application setting or parameter to allow the field administrator to specify the server would be most helpful.

       
AJP's avatar
AJP
311 posts
16 years ago
AJP's avatar AJP

I found a work around for the time being. I put the map custom field call into an embed, and was able to use the {embed:entry_id}-google-map instead of the {entry_id} since {embed} variables are earlier parsed than normal weblog:entries variables.

So, working for now, but might be confusing for other in the future.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Stephen, here’s a feature request: International Google service support.

Well, that’s something I’d never heard about before. I’ll add it to the feature requests list Brendon, although it’s probably quite low down the pecking order, to be honest.

I put the map custom field call into an embed, and was able to use the {embed:entry_id}-google-map instead of the {entry_id} since {embed} variables are earlier parsed than normal weblog:entries variables.

Ok, thanks for letting me know AJ. That was going to be my next suggestion, as an interim measure. I’ll still try to find a more elegant solution, but at least you’ve got it working for now.

Cheers, Stephen

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

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?

Best wishes,

Mark

       
Ridge's avatar
Ridge
44 posts
16 years ago
Ridge's avatar Ridge

Fantastic work on this extension, Stephen. I love how easy it is (for me and my clients) to add Google Map info.

If I may, I’d like to offer a suggestion (and I’m thinking it may already be on your feature list): The ability to use the driving directions utility within the generated map. I think this probably falls under your item:

[quote author=”Stephen Lewis”] 4. Expose the Google Map events, to enable greater interaction with the maps — click on a pin, and a details box appears, that sort of thing.

I know for myself, having this ability would be absolutely fantastic.

       
Yvonne Martinsson's avatar
Yvonne Martinsson
204 posts
16 years ago
Yvonne Martinsson's avatar Yvonne Martinsson

I cannot enable SL Google Maps in the FieldFrame prefs. I get a show/hide link that doesn”t work (Safari, Mac). No radio button to enable the extension. Where’s the problem? In this extension or in FieldFrame?

See this discussion for further details.

       
Brendon Carr's avatar
Brendon Carr
135 posts
16 years ago
Brendon Carr's avatar Brendon Carr
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. 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.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

@Ridge

If I may, I’d like to offer a suggestion (and I’m thinking it may already be on your feature list): The ability to use the driving directions utility within the generated map.

You’re right, that does fall under the broader goal of “exposing the Google Map events” 😊

@yvonne

I cannot enable SL Google Maps in the FieldFrame prefs. I get a show/hide link that doesn’‘t work (Safari, Mac). No radio button to enable the extension. Where’s the problem? In this extension or in FieldFrame?

Sounds more like a FieldFrame issue, as SL Google Map isn’t really doing anything at that point. Do you have jQuery for the Control Panel installed and enabled?

Cheers, Stephen

       
goodcompany's avatar
goodcompany
51 posts
16 years ago
goodcompany's avatar goodcompany

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>
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
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

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

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

       
goodcompany's avatar
goodcompany
51 posts
16 years ago
goodcompany's avatar goodcompany

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.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
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

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill
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.

       
First 3 4 5 6 7 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.