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

Version 1.1.2 : Released 15th September, 2009 * Merged a couple of FieldFrame compatibility updates, generously provided by Brandon Kelly. Shuddered quietly at the thought of him tutting as he looked at my code.

Version 1.1.1 : Released 9th July, 2009 * Tidied up code in _display_field method.

Version 1.1.0 : Released 9th July, 2009 * Added “map type” control to maps in Control Panel. * Removed custom stand-alone entry form code, and updated extension to work with FieldFrame’s (new) native SAEF support. * Updated the way map and pin data is stored in the database (now uses a serialized array). * Addressed various minor niggling bugs.

Version 1.0.9 : Released 20th May, 2009 * Implemented more robust ‘is a string’ tests, as passing an empty selector to jQuery 1.3.x causes an exception.

Version 1.0.8 : Released 14th May, 2009 * Added ‘map type’ support for templates and SAEFs.

– Hello all,

I’ve just released SL Google Map, a custom EE fieldtype that makes it easy to add one or more Google Maps to your website.

Here are a few of the highlights:

  • Easily pinpoint a location right from within the standard Publish or Edit page using full Google Maps functionality (pan, zoom, drag & drop).
  • Search by location name or postcode for any country that is supported by Google Maps (which appears to be pretty much all of them).
  • Accurately pinpoint UK postcodes (something the standard Google Maps API struggles with).
  • Add and edit entries via your own custom Stand-Alone Entry Forms.
  • Specify different default locations and zoom-levels for each of your SL Google Map fields within the Control Panel.
  • Easily display maps within your templates using the standard weblog entries tag.
  • Control the appearance and behaviour of each individual map in your templates.
  • Specify custom “fallback” content for browsers that can’t display the Google Map, on a map-by-map basis. This can include any standard HTML element you like.

Download SL Google Map page from my site, where you can also find the full documentation (including a short a video of the extension in action).

Support will be handled via this thread, so if you have any questions or comments, please leave a message.

Cheers, Stephen

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
16 years ago
Matt Weinberg's avatar Matt Weinberg

Wow Stephen, great work. This will make the lives of many people much, much, easier.

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo

Hey Stephen 😊

Great extension! I’m going to test this out for a website I was about to launch which uses custom fields.

One request (if it’s not in there). The ability to grab the Google URL for this location. I usually create a link to the full Google URL so they can see the map in greater detail. If you manage that then you are a star!!

Also, I’m not sure if it is faster if you limit by location (e.g .com.au or .co.uk).

Oh and I’m now following you on Twitter!

       
PXLated's avatar
PXLated
1,800 posts
16 years ago
PXLated's avatar PXLated

Somewhat off-topic but related… I’ve used Google Maps and developer keys for live sites but If developing locally (MAMP) how does one do it?

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Great extension Stephen! I just installed it and it is asking for CP jQuery 1.2.6, and I already have it enabled? Something I am doing wrong?

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo
Somewhat off-topic but related… I’ve used Google Maps and developer keys for live sites but If developing locally (MAMP) how does one do it?

Just use the local URL for example -

http://local.site.com

       
PXLated's avatar
PXLated
1,800 posts
16 years ago
PXLated's avatar PXLated

Cool - Thought it would require some finagling for some reason.

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo

Simply have your local site as -

http://local.domain.com

and your live one as http://www.domain.com

One code is needed and that’s it.

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

Wow, busy night around here, and in a good way!

One request (if it’s not in there). The ability to grab the Google URL for this location. I usually create a link to the full Google URL so they can see the map in greater detail. If you manage that then you are a star!!

It’s not built-in at the moment, but you could create it using the {map_lat}, {map_lng}, and {map_zoom} info. Something like this, placed inside the tag pair for your custom map field, should do the trick:

http://maps.google.com/maps?f=qsource=s_qhl=en&ie=UTF8&ll={map_lat},{map_lng}&z={map_zoom}

Note that this doesn’t display the pin, just the correct location… I’ll need to dig into the Google docs a bit more to find out the full story. Oh, and thanks for the Twitter follow 😉

Great extension Stephen! I just installed it and it is asking for CP jQuery 1.2.6, and I already have it enabled? Something I am doing wrong?

That may have been a blunder on my part… I specified “cp_jquery” version 1.2.6 as a minimum requirement for the fieldtype, but it’s clearly not working as expected. Apologies for the inconvenience – version 1.0.6 solves this problem.

Simply have your local site as - http://local.domain.com and your live one as http://www.domain.com

You know, I never thought of doing it that way. For “that’s the way I’ve always done it” reasons, I’ve had my local dev copy as http://domain.local:9010, meaning I needed an API key for the local site, and another for the live. What a tit. pokes self in eye

Cheers, Stephen

       
stinhambo's avatar
stinhambo
1,268 posts
16 years ago
stinhambo's avatar stinhambo

No problem mate! I’ll try your suggestion. Some observation of the Google URL would have made that obvious but I was clearly too lazy to think!

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
No problem mate! I’ll try your suggestion.

Cool, let me know how you get on.

Cheers, Stephen

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Thanks Stephen, it’s now working as advertised. Great work BTW! Cheers

Ryan

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Thanks Stephen, it’s now working as advertised.

Good stuff.

Cheers, Stephen

       
jwmatlock's avatar
jwmatlock
14 posts
16 years ago
jwmatlock's avatar jwmatlock

I’m getting this error on my publish pages:

Sorry, but you need JavaScript enabled in order to use this feature.

I have jquery enabled. What am I missing? I just installed the latest 1.0.7 version.

Thanks!

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

Hi there,

I have jquery enabled. What am I missing? I just installed the latest 1.0.7 version.

Are you getting any JavaScript errors?

If not, it could just be that the page is taking some time to load, and you’re seeing that message prior to the JS running – there’s quite a bit of JavaScript to load (if it hasn’t previously been cached), particularly if you’re using the Google-hosted jQuery libraries.

If there are JS errors being reported, let me know the error details (and your chosen browser / platform), and I’ll look into it.

Cheers, Stephen

       
1 2 3 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.