Google Member Map

Started by Spuds, December 12, 2007, 01:49:12 PM

Previous topic - Next topic

Storman™

Guess you could completely removed the whole function (as below) - that will certainly get rid of the generated button.

function imb_googlemap(&$buttons)
{
global $txt, $scripturl, $modSettings;

loadlanguage('GoogleMap');

// where do we want to place this new button
$insert_after = empty($modSettings['googleMap_ButtonLocation']) ? 'calender' : $modSettings['googleMap_ButtonLocation'];
$counter = 0;

// find the location in the buttons array
foreach ($buttons as $area => $dummy)
{
if (++$counter && $area == $insert_after)
break;
}

// Define the new menu item(s)
$new_menu = array(
'googlemap' => array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMap_Enable']) && allowedTo('googleMap_view'),
'sub_buttons' => array(),
)
);

// Insert the new items in the existing array with array-a-matic ...it slices, it dices, it puts it back together
$buttons = array_merge(array_slice($buttons, 0, $counter), array_merge($new_menu, array_slice($buttons, $counter)));
}


However, ideally instead of removing the code you'd be better off amending it so that it creates the button in the postion where you want it.

GlitchPC

Agreed...but, I'm not a coder...hence, the help request.  I want to add it as a sub-menu item to the main "Members" tab.

GlitchPC

Quote from: Spuds on July 05, 2011, 03:29:19 PM
Quote from: joey791 on July 04, 2011, 11:34:07 AM
Quote from: Kindred on July 02, 2011, 10:21:27 PM
Modify the menu in subs.php

I need to know how to modify the code in the GoogleMap20integration.php first
If you want the button as part of the members drop down menu then replace the entire function imb_googlemap(&$buttons) in GoogleMap20integration.php  with this

function imb_googlemap(&$buttons)
{
global $txt, $modSettings, $scripturl;

// Place the button at the end of the member slide out menu
$buttons['mlist']['sub_buttons']['googlemap'] = array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
);
}


Spuds...

I tried this edit with the latest version of this mod...and it didn't work.  Granted...I know it was for a different template, but I was hoping it would work for what I wanted to do.  I currently use SMF 2.0.2 and the latest version of this mod.

ThunderBucks

I found that this mod will work on my site but only if viewed with Firefox.  What would cause this issue? 


Spuds

Quote from: GlitchPC on December 31, 2011, 03:23:40 PM
Spuds...

I tried this edit with the latest version of this mod...and it didn't work.  Granted...I know it was for a different template, but I was hoping it would work for what I wanted to do.  I currently use SMF 2.0.2 and the latest version of this mod.
OMG ... someone used search :)

That edit should still work, but you may need to add in the loadlanguage like this .... just replace the current function with this one ....

function imb_googlemap(&$buttons)
{
global $txt, $scripturl, $modSettings;

loadlanguage('GoogleMap');

// Place the button at the end of the member slide out menu
$buttons['mlist']['sub_buttons']['googlemap'] = array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
);
}

GlitchPC

#1605
Spuds...

Parse error: syntax error, unexpected '}' in /xxx/xxx/xxxxx/xxxxxxxx/xxxxxxxx/Sources/GoogleMapIntegration.php on line 39

Replaced this:
function imb_googlemap(&$buttons)
{
global $txt, $scripturl, $modSettings;

loadlanguage('GoogleMap');

// Place the button at the end of the member slide out menu
$buttons['mlist']['sub_buttons']['googlemap'] = array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
);
}


...with the code you supplied.

So then, I replaced this:
function imb_googlemap(&$buttons)
{
global $txt, $scripturl, $modSettings;

loadlanguage('GoogleMap');

// Place the button at the end of the member slide out menu
$buttons['mlist']['sub_buttons']['googlemap'] = array(
'title' => $txt['googleMap'],
'href' => $scripturl . '?action=googlemap',
'show' => !empty($modSettings['googleMapsEnable']) && allowedTo('googleMap_view'),
);
}

// Insert the new items in the existing array with array-a-matic ...it slices, it dices, it puts it back together
$buttons = array_merge(array_slice($buttons, 0, $counter), array_merge($new_menu, array_slice($buttons, $counter)));
}


parse error went away, but the link isn't showing...

Spuds

those 4 lines after the first } should not be there .... if you want just attach your googlemapintegration file and I'll take a look (since I'm not sure which version you are running)

GlitchPC

Here ya go...and thanks...

Happy New Year, by the way...

Oh...and I'm using 2.6 of your mod...

GlitchPC

Thanks, Spuds!  Worked like a charm...much appreciated!

ThunderBucks

Since no one replied to my post does this mean there is no solution for the problem I am having?

GlitchPC

Quote from: ThunderBucks on January 01, 2012, 06:31:51 PM
Since no one replied to my post does this mean there is no solution for the problem I am having?

I've tested this mod on all recent versions of major browsers:  Firefox, IE, Opera, Chrome, and Safari.  No issues with any of those browsers displaying the Google Member Map.

Chas Large

Quote from: ThunderBucks on January 01, 2012, 06:31:51 PM
Since no one replied to my post does this mean there is no solution for the problem I am having?
If you read back just a bit, you'd have seen that Storman complained it wasn't working on Google Chrome but several of us confirmed that it does.
I've just tested it on Chrome, FireFox, Internet Explorer, Opera and Safari (for PC). So it must be something on your PC blocking the google map code or the mod is not installed correctly.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

ThunderBucks

OK thank you for the replies maybe it is just my browser, I will check.

Storman™

QuoteIf you read back just a bit, you'd have seen that Storman complained it wasn't working on Google Chrome but several of us confirmed that it does.

Actually it was fals who said that, not me Chas, cheers  ;)

Chas Large

Quote from: Storman on January 04, 2012, 05:30:42 AM
QuoteIf you read back just a bit, you'd have seen that Storman complained it wasn't working on Google Chrome but several of us confirmed that it does.

Actually it was fals who said that, not me Chas, cheers  ;)

My apologies, I misread the quoted reply you gave. Sorry  :-\
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

kwolf

#1615
On the member map the pins are showing up in the wrong places.  When you zoom in and out, the pin moves from where it was at the previous zoom level.  The problem is such that after a couple zooms out the pin appears in a totally different state, and at max zoom level the pin is in upper Canada instead of in Tennessee.  You can see the problem here: h##p://tnfurs.net/forum/index.php?action=googlemap

On the member page where you place the pin, this problem is not present.  You can zoom in/out all day and the pin is over the correct place.  The problem only happens on the actual member map.  I am using the latest version of this mod.  I tried IE9 and Chrome.  I also tried the default theme instead of the one I am using now, but the problem persists.  Any ideas what could be causing this issue?

Chas Large

Quote from: kwolf on January 06, 2012, 03:29:08 AM
On the member map the pins are showing up in the wrong places.  When you zoom in and out, the pin moves from where it was at the previous zoom level.  The problem is such that after a couple zooms out the pin appears in a totally different state, and at max zoom level the pin is in upper Canada instead of in Tennessee.  You can see the problem here: h##p://tnfurs.net/forum/index.php?action=googlemap

Just tried this on my FIreFox browser and it stayed at the junction of Boones Creak Road and the I26 all the way zoomed in and out, either by clicking or dragging the zoom slider. I would suggest your browser cache might be requiring a clearout maybe?
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

kwolf

Thanks for the fast reply.  I just installed firefox and have the same issue.  I also tried it on the laptop thinking it might just be my PC, but no go.  Here's some screenshots of the problem, you can see at one zoom level the point looks like it's in Southwest Virgina, but it should actually be at I-26 & Boones Creek Rd in Tennessee like you mentioned.  The futher in I zoom the closer it is to the right spot.  The closer zoom levels are all fairly accurate.


Chas Large

I don't think you can expect to place a pin that accurately when zoomed out, try hitting the same spot on an atlas or a globe?

I just placed a pin is virtually the same spot as yours on my test forum, zoomed out and back in, the pin was still in the same place but in the zoomed out image does not look like it's in the right place. I thinks it's a perception of accuracy thing not a bug.

See shots attached.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

kwolf

#1619
I think you're right.  If you go to the screen where you place the pin (in your profile) and zoom really far out like that, the pin looks like it's in a much more accurate place compared to the member map.  That is why I thought there might be a bug.  That probably has something to do with the image it's using for the icon though since it uses the red google one and not the custom one.

Edit: Changed the pin size from 25 to 40 to closer match the pin on the profile page and it is pretty much accurate at all zoom levels.  Simple solution for my nitpick :)

Advertisement: