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

Michael C. (KKCJ)'s avatar
Michael C. (KKCJ)
100 posts
15 years ago
Michael C. (KKCJ)'s avatar Michael C. (KKCJ)

Ahh, THAT’s how you assign a title. I couldn’t get it to work on my own. Thanks!

       
jonwrightmedia's avatar
jonwrightmedia
75 posts
15 years ago
jonwrightmedia's avatar jonwrightmedia

Thanks for such a wonderful extension Stephen, this is one I would feel happy paying for too.

I have one small issue, which isn’t a deal-breaker, but would be nice if I could tackle it.

The maps on my site are only very small (200px x 200px) which would be fine, but the ‘Map Data 2009’ text at the bottom pokes out of the side of the map and looks a bit messy. Is there a way I can remove this completely?

Cheers.

       
Jim Robinson's avatar
Jim Robinson
15 posts
15 years ago
Jim Robinson's avatar Jim Robinson

Thanks for creating this great extension, Stephen. I’m very close to being able to adapt this to my needs. The one feature I need on certain pages is the ability to have multiple pins, clickable details box for each pin, etc. The post from Paul Frost solved part of the puzzle for me, but I couldn’t get it to work.

To troubleshoot, I simplified and attempted to use the code you show in one of your previous posts to just show the pin_lat and pin_lng data. That does output the data I need, but not before spitting out some error messages:

Notice: Uninitialized string offset: 0 in /system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 594

Notice: Uninitialized string offset: 0 in /system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 595

Notice: Uninitialized string offset: 0 in /system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 596

Notice: Uninitialized string offset: 0 in /system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 597

Notice: Uninitialized string offset: 0 in /system/extensions/fieldtypes/sl_google_map/ft.sl_google_map.php on line 598

This is the exact code I’m using in the template for my test page:

{exp:weblog:entries weblog="localorganizations" disable="categories|category_fields|member_data|pagination|trackbacks"}
    
{title}

{googlemap}{pin_lat}, {pin_lng}{/googlemap}

{/exp:weblog:entries}

Any idea why it’s producing these errors?

Thanks, Jim

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

@jonparadise2

The maps on my site are only very small (200px x 200px) which would be fine, but the ‘Map Data 2009’ text at the bottom pokes out of the side of the map and looks a bit messy. Is there a way I can remove this completely?

That’s all taken care of by Google, so it’s not an issue I can address. A quick look through the Google-generated code suggests you may be able to hide it (in decent browsers), using the following snippet of CSS:

.sl-google-map #logocontrol + div span {display : none;}

@Jim

I’ve just set up a dummy template, and can’t reproduce the above errors, so I’m not sure what to suggest. You could try replacing this code (around line 586):

// Initialisation done, let's get swapping.
$r = preg_replace(
    '/' . LD . 'map' . RD . '(.*?)' . LD . SLASH . 'map' . RD .'/s',
    $this->_display_field($field_id, $field_data, $field_settings, $init),
    $tagdata
    );

…with this code:

// Initialisation done, let's get swapping.
$r = '';
$r .= preg_replace(
    '/' . LD . 'map' . RD . '(.*?)' . LD . SLASH . 'map' . RD .'/s',
    $this->_display_field($field_id, $field_data, $field_settings, $init),
    $tagdata
    );

That’s a bit of a long-shot, but it may be worth a try. Let me know how you get on.

Stephen

       
Jim Robinson's avatar
Jim Robinson
15 posts
15 years ago
Jim Robinson's avatar Jim Robinson

Thanks for the suggestion, Stephen. Gave that a try, but still getting the errors. Works fine on my page with a single pin.

-Jim

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

Hi Jim,

Works fine on my page with a single pin.

Can you clarify please? I’m a little confused.

Thanks, Stephen

       
Jim Robinson's avatar
Jim Robinson
15 posts
15 years ago
Jim Robinson's avatar Jim Robinson

Sure, I’ll try to clarify. I have your extension working as intended in the case of a single weblog entry with a single pin. I attempted to use Paul Frost’s solution here so I could create a map with multiple pins and info boxes, but couldn’t get it to work.

To troubleshoot, I placed the following code on a test template:

{exp:weblog:entries weblog="localorganizations" disable="categories|category_fields|member_data|pagination|trackbacks"}
    
{title}

{googlemap}{pin_lat}, {pin_lng}{/googlemap}

{/exp:weblog:entries}

That does output all entries in my “localorganizations” weblog along with latitude and longitude for each, but first it spits out the error messages I indicated previously.

I’m really just looking for a way to pull {pin_lat} and {pin_lng} without errors so I can make use of it outside of your extension.

Thanks, Jim

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

Hi Jim,

I can’t reproduce this problem. If you PM control panel login details, I’ll see if I can track down the cause.

Cheers, Stephen

       
Jim Robinson's avatar
Jim Robinson
15 posts
15 years ago
Jim Robinson's avatar Jim Robinson

Hi Stephen,

I really appreciate that offer, but I actually just figured out the problem. I had four existing weblog entries in the weblog I’m using with your extension. I edited one of the entries and it updated the lat/lng info for that entry only. When I attempted to display multiple pins on a single map and it looped through all four weblog entries, the first three returned errors because not lat/lng had been set for them. I edited each entry and now it works fine. Seems obvious now.

Thanks again for a great extension.

Thanks, Jim

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

Hi Jim,

Glad you got it sorted. I’ll see if I can recreate that problem, because it sounds like a bug in the extension.

Cheers, Stephen

       
Adrienne L. Travis's avatar
Adrienne L. Travis
213 posts
15 years ago
Adrienne L. Travis's avatar Adrienne L. Travis

I had a job where i had to add an SL Google Map field to a weblog that already had 200 entries in it, and didn’t want to have to enter all that data by hand. And i did in fact manage an import, albeit an AMAZINGLY cobbled-together one. But it worked! I’m thinking i’ll try to automate it more and then post directions for anyone else having the same problem.

       
sambo's avatar
sambo
80 posts
15 years ago
sambo's avatar sambo

Hi,

this extension looks like it is just what I need. Thanks for sharing.

Can it be used to display more than one marker on the map? From what I have seen all the examples display just one marker.

Can I use the extension for input in the control panel but not use the {map} tag for output and rather use my own code for map display? How would I get the position from the field

Best, Sammi

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

Sammi,

Can it be used to display more than one marker on the map? From what I have seen all the examples display just one marker.

As it stands, the extension only supports one marker per map.

Can I use the extension for input in the control panel but not use the {map} tag for output and rather use my own code for map display? How would I get the position from the field

The documentation should tell you everything you need to know.

Cheers, Stephen

       
pab514's avatar
pab514
181 posts
15 years ago
pab514's avatar pab514

I’m currently getting this error

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

i moved the global_script.js file to my js folder, that’s pretty much the only thing i’ve changed.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
15 years ago
Stephen Lewis's avatar Stephen Lewis
i moved the global_script.js file to my js folder, that’s pretty much the only thing i’ve changed.

You can, if so desired, copy the global_script.js file to another folder, you can’t move it.

Cheers, Stephen

       
First 10 11 12 13 14 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.