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.
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
@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
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
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
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.
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
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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.