vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   VBGooglemap Member Edition (https://vborg.vbsupport.ru/showthread.php?t=99920)

snipeyhead 08-11-2008 12:20 PM

I had no expectation of the author helping. People were posting fixes, so I wanted to make it clear that the previous fixes were not helpful to my particular install, in case other people were having the same problem. And then when I found my own solution, I posted it - so people could benefit. Which is the whole point of having a forum. So whatever.

PoetJA-1975 08-11-2008 05:24 PM

Oh Pa! Get over yourself.
Obviously you'd expect a modification that is checked as supported to actually be supported - in this case it isn't so - I was simply stating that fact - So take that little attitude and 5 posts of yours and shove off somewhere.

Unsubscribed. A total waste of time anyway.

Jacquii.

snipeyhead 08-11-2008 05:32 PM

LOL nice attitude.

K4GAP 10-06-2008 01:11 PM

Does anyone know of anything similar to this that works? And, would work on 3.7?

MonkYZ 10-09-2008 05:46 AM

Thx ZerHour for the fix. Now inside the VBGooglemap page i get less errors (before i got like 29 errors, now only 2). Unfortunatelly, still no pins on the map (and i made markers.xml from zero).

The errors look like this (as you can notice there is still a "&" character which i suppose it's the culprit):
Code:

Line:921
Char:26
Code:0
Error:Object expected
URL:http://www.consolegames.ro/forum/vbgooglemapme.php?lat=44.4327992256&lng=26.0314178467&zoom=6

Code:

Line:1209
Char:3
Code:0
Error:Invalid pointer

URL:http://www.consolegames.ro/forum/vbgooglemapme.php?lat=44.4327992256&lng=26.0314178467&zoom=6

Can you please help me fix this ? Thank you in advance !

Quote:

Originally Posted by ZeroHour (Post 1456241)
Right I have my first fix. I will be editing this post with future changes so you can refer back to it and bookmark it by clicking the post number to the right.

Fix for no markers shown:

Edit:

/includes/functions_vbgooglemapme.php:

Goto line 49 which should start:
PHP Code:

$text_file .= "<marker mapid=\" 

Replace that line with:
PHP Code:

$text_file .= "<marker mapid=\""htmlspecialchars($get_xml_marker["mapid"])."\"  title_map=\"".htmlspecialchars($get_xml_marker["title_map"])."\" lng=\"".htmlspecialchars($get_xml_marker["lng"])."\" lat=\"".htmlspecialchars($get_xml_marker["lat"])."\" userid=\"".htmlspecialchars($get_xml_marker["userid"])."\" username=\"".preg_replace("/\n|\r\n|\r/""",nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["username"])))))."\" text_map=\"".preg_replace("/\n|\r\n|\r/"""nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["text_map"])))))."\" type=\"".htmlspecialchars($gettype['googlemapmetype'])."\" pimage=\"".htmlspecialchars($pimage)."\" />\n"


/includes/cron/vbgooglemapme_cron.php:

Goto line 58 which should start:
PHP Code:

$text_file .= "<marker mapid=\" 

Replace that line with:
PHP Code:

$text_file .= "<marker mapid=\"".htmlspecialchars($get_xml_marker["mapid"])."\"  title_map=\"".htmlspecialchars($get_xml_marker["title_map"])."\" lng=\"".htmlspecialchars($get_xml_marker["lng"])."\" lat=\"".htmlspecialchars($get_xml_marker["lat"])."\" userid=\"".htmlspecialchars($get_xml_marker["userid"])."\" username=\"".preg_replace("/\n|\r\n|\r/""",nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["username"])))))."\" text_map=\"".preg_replace("/\n|\r\n|\r/"""nl2br(addslashes(htmlspecialchars(trim($get_xml_marker["text_map"])))))."\" type=\"".htmlspecialchars($gettype['googlemapmetype'])."\" pimage=\"".htmlspecialchars($pimage)."\" />\n"

Run the scheduled task and your markers should return.
Basically I have modified the code to replace things like "&" with the xml safe "&amp;" so no matter what anyone enters for the fields the xml should still be safe.

More tweaks to come including integration of the display groups being marker colour.


Cobra-J82 10-11-2008 06:24 AM

I have vb 3.7.3
After doing what ZeroHour Said
I'm still not able to view the pins
This is my Error Details:

Webpage Script Errors

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 1.1.4322; InfoPath.2)
Timestamp: Sat, 11 Oct 2008 07:23:19 UTC

0.
Message: Invalid argument.
Line: 1285
Char: 3
Code: 0
URI: http://www.***********.com/vbgooglemapme.php

Would realy appreciate it if some one have an idea to fix this
Knowing that some guys with 3.7.3 VB have no problem at all.

Cobra-J82 10-12-2008 07:51 AM

Okay Guys
I think I know a Good solution for times Being
After u Do wat ZeroHour said regarding replacing the Code in the php files

Disable:
Enable or disable the small map control (disable for better performance)

And try It
If it didnt work
Disable:
Enable the mouseover support on the markers?

For me it worked Fine When I only Disabled:
Enable or disable the small map control (disable for better performance)

Cheers

MonkYZ 10-12-2008 11:54 AM

Thx Cobra-J82. That solved my problem too :)

lpetrich 10-28-2008 06:04 AM

ZeroHour's fix worked for me also. Thanx, ZeroHour, for going through all the trouble to come up with it.

And I've contributed some other fixes and additions in the 3.6 thread: VBGooglemap Member Edition

They are:

* In edit mode, the marker is always the vbGoogleMap red marker, instead of Google Maps's default marker.

* Mousewheel zooming is enabled.

* Terrain display is enabled.

* When mousing over does not make a vbGoogleMap info balloon, it instead makes a HTML-element title that contains the username. This fix thus produces the best of both worlds: a nondisruptive quick look, and a detailed info balloon with more info.

I haven't made terrain display an option for the default display, because I'd have to do a lot of tracking down of where it is set and handled and so forth.

I have also explored the feasibility of making markers draggable in edit mode. It is easy to set up a draggable marker; when you create it, include draggable:true in its marker options. But you also have to set up some event listeners for the marker's motions, and that's a bit trickier and more difficult to debug.

BTW, the site I'm a sysadmin of is at vBulletin 3.7.0 and I've had no troubles that can reasonably be attributed to vBulletin being at this version.

reactortrip 11-16-2008 04:01 PM

Anyone have any problems with this when someone has injected something into the api that causes it to link to a stupid anti virus site when you try to do anything with this hack? Where is the api key located in the database?

pooslokka 11-19-2008 01:57 PM

Thank you just installed Great pluging cheers.
i have few problems.
i feed very had to go each post in this thread and find my question has been answered or not.

My qestion is :

1. I want the White Tool Tip like stuff that contain the user location information auto appear insted of on clicd on the marker. coz it confuses.

2. is there a way to limit the size of the picture allowed?

Marked as install and nominated :thumb:

lpetrich 11-19-2008 04:30 PM

To make the info bubbles only appear when clicking on a marker, go to

Admin CP > Vbgooglemap ME > ME Settings > Enable the mouseover support on the markers?

For setting the maximum size of an image, one would have to edit product-vbgooglemapme.xml

Line 550:
var content2 = "<img width=\"$gmimagemax\" border=\"0\" src=\""+pimage+"\"></a>";

I'm thinking of something like
var content2 = "<img style=\"max-width: $gmimagemax; max-height: $gmimagemax\" border=\"0\" src=\""+pimage+"\"></a>";

The picture will get displayed, but would get shrunken in both dimensions to fit a maximum-dimension square. That dimension is set in ME Settings as

Default width for the balloon on marker

And after editing product-vbgooglemapme.xml be sure to reinstall it.


For some additional fixes, do some more editing of product-vbgooglemapme.xml:

To make mousing over only show the username, change:

Line 550:
var marker = new GMarker(point, icon);
to
var marker = new GMarker(point, {icon:icon, title:username});

BTW, the former syntax for the GMarker constructor is now deprecated. What I substituted for "icon" is a GMarkerOptions object, which is a JavaScript property list.

To enable mousewheel zooming and terrain display, add these lines:

map.enableScrollWheelZoom();
map.addMapType(G_PHYSICAL_MAP);

after the following lines:

Line 598:
map = new GMap2(document.getElementById("memap"),$map_type);
Line 855:
map = new GMap2(document.getElementById("mapme"),$map_type);
Line 1129:
map = new GMap2(document.getElementById("mapme"),$map_type);

Fix of marker appearance in edit mode:

Line 863:
map.addOverlay(new GMarker(point, icon));
to
map.addOverlay(new GMarker(point, {icon:icon}));

Line 877:
map.addOverlay(new GMarker(point));
to
map.addOverlay(new GMarker(point, {icon:icon}));

Fix of marker position on map:

Change all occurrences of

icon.iconAnchor = new GLatLng(...);
icon.infoWindowAnchor = new GLatLng(...);


to

icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(8, 1);


Coordinates are left-to-right, top-to-bottom.

There are several improvements that I didn't bother to try to make:
  • Adding a "terrain" option to the possible default views (may require hunting through several files)
  • Adding draggability in edit mode
  • Making edit-mode recentering optional
But if you people are interested, I could try to make them.

To add draggability you set draggable:true in the marker's options, then set up a GEvent listener that gets the "moveend" event and updates the displayed position accordingly. The reason that it was not originally present was because vbGoogleMap had originally been coded for an older version of the Google Map API that had lacked this and several other convenient features.

lpetrich 11-20-2008 12:59 AM

I've gone ahead and implemented this fix:

Centers an image in the info balloon's "Image" tab. If the image is larger than the maximum allowed size in either direction, then it will be rescaled to fit.

In product-vbgooglemapme.xml

Line 550:
var content2 = "<img width=\"$gmimagemax\" border=\"0\" src=\""+pimage+"\"></a>";
to
var content2 = "<img style=\"max-width: {$gmimagemax}px; max-height: {$gmimagemax}px; display: block; text-align: center; margin: auto; vertical-align:middle\" src=\""+pimage+"\">";

-

I've also tracked down the code for selecting the default map type; I will be posting it when I implement it.

lpetrich 11-20-2008 01:34 AM

Fix: added the ability to choose "Terrain" as a default map type:


In vbgooglemapme_admin.php

After line 39:
'3' => 'Satellite',
add
'4' => 'Terrain',


In vbgooglemapme.php

After line 73,
change
if ($maptype == 1)
{
$map_type = "{mapTypes:[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP]}";
}
...
}

to
switch ($maptype) {
case 1:
$map_type = "G_NORMAL_MAP";
break;
case 2:
$map_type = "G_HYBRID_MAP";
break;
case 3:
$map_type = "G_SATELLITE_MAP";
break;
case 4:
$map_type = "G_PHYSICAL_MAP";
break;
}



In product-vbgooglemapme.xml

change
map = new GMap2(document.getElementById("mapme"),$map_type);
to
map = new GMap2(document.getElementById("mapme"));
and likewise for "memap" instead of "mapme".

After
map.addMapType(G_PHYSICAL_MAP);
add
map.setMapType($map_type);


I'd earlier described my terrain fix, which involves adding the line
map.addMapType(G_PHYSICAL_MAP);
after each instance of
map = new GMap2(...);

pooslokka 11-20-2008 04:36 AM

Quote:

To make the info bubbles only appear when clicking on a marker, go to
thank you for your kind reply. but i just want the bubbles to appear on loading without need to click.

i can now see this are in the vbgooglemap.php file


Code:

if ($mouseoversupport == 0)
{

                $getlistenerinformation = "
                GEvent.addListener(marker, \"click\", function() {
                marker.openInfoWindowTabsHtml(infoTabs);
            id = document.getElementById('username');
            id.innerHTML = username;

                  });
                ";
                 
}
if ($mouseoversupport == 1)       
{         
          $getlistenerinformation = "
          GEvent.addListener(marker,\"mouseover\", function() {
          marker.openInfoWindowTabsHtml(infoTabs);
                  document.getElementById('username').value= username;
            id = document.getElementById('username');
            id.innerHTML = username;

        });
          ";       
 
}


lpetrich 11-20-2008 06:14 AM

Quote:

Originally Posted by pooslokka (Post 1669144)
thank you for your kind reply. but i just want the bubbles to appear on loading without need to click.

I'm getting confused. Are you wanting the info bubbles to always be visible?

That is, without needing to mouse over or click on their markers. The AdminCP option I'd referred to earlier was for setting mouseover vs. clicking.

As far as can tell from the Google Maps API reference and elsewhere on "info windows", there is only one info-bubble object per map, but one that vbGoogleMap revises each time one mouses over or clicks on a marker. So it does not seem possible to display several info bubbles at once.

pooslokka 11-20-2008 07:51 AM

yes yes, always be visible :D
When load, the bubble also should appear. then the viewer can close it if he want.

pooslokka 11-20-2008 09:03 AM

http://img444.imageshack.us/img444/7640/pscxg9.jpg

when you click show on map, that users bubble should appear on load. but what i see is it shows all the users marks and hard to find the one that relevant to the user in that raw.

pooslokka 11-25-2008 10:35 AM

pls help !

http://img300.imageshack.us/img300/8794/pscim6.jpg

i want to add in the "Map" word that link to each users map location now we have in table.
how can i do that?

Edited :

I added a link to the Post Bit and try to use the url. but the cordinates are not retrived for earch user. the post is empty :(

Code:

<a href="$bburl/vbgooglemapme.php?lat=$getinfo_me_list[lat_map]&lng=$getinfo_me_list[lng_map]&zoom=$linkzoomlevel" target="_self">$vbphrase[vbgooglemapme_map_link]</a>

gamma912 11-28-2008 10:04 AM

I would like to use this so that my members can upload photos and chart them on the map - and then other users can see the photos and where they were taken - is it possible with this MOD?

Atlantean 12-07-2008 05:14 PM

The markers are no longer visable on my forum http://totalopel.com/forum/vbgooglemapme.php

The info is in the database as I can see in from the control panel and it will also zoom in to the users location when you click on My Location.

Any idea what has gone wrong?

lpetrich 12-08-2008 12:34 AM

I recommend trying ZeroHour's fix in the 3.6 version of this thread. That fixed the disappearing-markers problem for me; it is due to the original version producing malformed XML for <forum-root>/markers.xml

And I invite you people to try out my fixes also.

Atlantean 12-08-2008 07:42 AM

Thanks lpetrich - I shall give it a go later!

Atlantean 12-09-2008 07:49 AM

Quote:

Originally Posted by lpetrich (Post 1680642)
I recommend trying ZeroHour's fix

That did the job - markers are back again :up:

Blaster_CGN 01-17-2009 09:09 AM

Hi,

since a few weeks i have a problem with 3.01 version.
When i visit the VBGoogleMap all Browser stop the Script with Error:
Warning: Slow script
(http://www.cbf-1000.de/VBForum/vbgoo...hp?do=showmain)
- Stop or Contiunue

It allways stop on the same Number (Loaded) 539 of 546


What can i do?


Greets Blaster

Mark Tomlinson 01-20-2009 02:21 PM

Quote:

Originally Posted by Blaster_CGN (Post 1715524)
Hi,

since a few weeks i have a problem with 3.01 version.
When i visit the VBGoogleMap all Browser stop the Script with Error:
Warning: Slow script
(http://www.cbf-1000.de/VBForum/vbgoo...hp?do=showmain)
- Stop or Contiunue

It allways stop on the same Number (Loaded) 539 of 546


What can i do?


Greets Blaster

When I look at http://www.cbf-1000.de/VBForum/markers.xml, marker 539 looks like this -
Code:

<marker mapid="612"  title_map="TGIF" lng="7.9487371444702" lat="48.090750620063" userid="2515" username="TGIF" text_map="Ich glaub\', hier bleib\' ich" type="green" pimage="http://www.cbf-1000.de/VBForum/images/googlemapme/noimage.png" />
Notice the part that reads
Code:

text_map="Ich glaub\', hier bleib\' ich"
This plug-in has a notoriously bad time with special characters. Try editing markers.xml and change the line to text_map is null, like the following.
Code:

<marker mapid="612"  title_map="TGIF" lng="7.9487371444702" lat="48.090750620063" userid="2515" username="TGIF" text_map="" type="green" pimage="http://www.cbf-1000.de/VBForum/images/googlemapme/noimage.png" />
That should fix the problem temporarily. A permanent fix can be found earlier in this thread.

Trana 01-22-2009 01:43 AM

Is there a way to create site markers for locations without having a member tag it? For example, I would like to hardcode some local attractions.

Can this be done in this version?

Blaster_CGN 01-22-2009 04:10 PM

Quote:

Originally Posted by Mark Tomlinson (Post 1719011)
A permanent fix can be found earlier in this thread.

Thx a lot for quick help!!
Did you have the Post-Number?
I could not find the Post.

Thx
Blaster

Mark Tomlinson 01-22-2009 04:57 PM

Yes, about two pages back somone points to a fix from member ZeroHour. You can find ZeroHour's post here.

https://vborg.vbsupport.ru/showthrea...51#post1456251

manning 01-26-2009 02:02 PM

There appear to be errors on the sample page - anyone have this up and working on 3.7 and have a link to your site?

Trana 02-03-2009 10:24 PM

Quote:

Originally Posted by Trana (Post 1720747)
Is there a way to create site markers for locations without having a member tag it? For example, I would like to hardcode some local attractions.

Can this be done in this version?

Can anyone help?

lpetrich 02-04-2009 10:39 AM

One would have to do some extra coding for such markers. In particular:
  • Code for displaying them
  • User interface for setting them up
  • Database interface for storing and retrieving their info
But one might use the existing code as a guide for what coding to do, though I am concerned that doing so will violate StonyArc's copyrights.

I don't have a test forum to work with, so some of you other people will have to code this. But I can help with the Google Maps parts; I can create HTML-page mockups with working code. And while I have some expertise with the Google Maps API, I don't have any with database-interface code. I have an elementary knowledge of SQL, and that's it.

Finally, has anyone tried contacting StonyArc? It would be nice to have his permission for using his code and posting updated archives, if he chooses to give it.

Mark Tomlinson 02-04-2009 01:22 PM

Quote:

Originally Posted by Trana (Post 1720747)
Is there a way to create site markers for locations without having a member tag it? For example, I would like to hardcode some local attractions.

Can this be done in this version?

I don't see why you couldn't change the markers.xml directly. Something like this;

Code:

<marker mapid="9999" title_map="Eiffel Tower" lng="-88.246731" lat="42.215226" userid="9999" username="Eiffel Tower" text_map="Eiffel Tower, France" type="blue" pimage="http://mysite.com/forums/images/googlemapme/noimage.png" />
Of course the link to the member's profile will result in a message that the user does not exist. But the rest should work fine.

lpetrich 02-04-2009 05:38 PM

The big problem is that markers.xml gets refreshed by a cron job, and by editing marker info. So one has a choice of:
  • Doing some coding to support such markers
  • Creating some sockpuppet accounts whose "locations" are those hardcoded places

carcomp 03-05-2009 04:38 PM

Has the issue been fixed where markers disappear from the map?

lpetrich 03-05-2009 04:59 PM

Quote:

Originally Posted by carcomp (Post 1761209)
Has the issue been fixed where markers disappear from the map?

ZeroHour has come up with a fix over in the vB-3.6 vbGooglemap thread, so you can check there. You'll have to edit some code files and re-upload them, but it works. It turns ' into \', but that's a small price to pay, because fixing that would mean more code rewriting.

ralle007 03-23-2009 04:37 PM

I?ve a problem too :-(
Couldn?t find anything about this problem:

First time, I click the link to the usermap, it works fine, the second time I click on, Iand most of my users) get this message:

Code:

<www.db-forum.de>

Der auf dieser Website verwendete Google Maps API-Schl?ssel wurde f?r eine andere Website registriert. Sie k?nnen unter http://code.google.com/apis/maps/ einen neuen Schl?ssel f?r diese Website erzeugen.

Warning: unserialize() expects parameter 1 to be string, array given in [path]/vbgooglemapme.php on line 64

I?ve created the key maybe five or six times, I?ve tried the subdirectory, but the result is always the same.

Has anybody an idea, what the problem is?


Thank you very much..

ralle007 03-27-2009 10:33 PM

Nobody here, who has a similar problem??

vbem2 05-02-2009 02:29 AM

Is there anyway to have it autopost from the user location fields? Say if they were all formatted to zip code or what have you? Thanks.

GrossKopf 06-22-2009 01:33 PM

This was working on my vb 3.8.2, but today all the markers are missing, although it says there are 6 of them...

http://flotgaming.net/forums/vbgooglemapme.php


All times are GMT. The time now is 05:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03124 seconds
  • Memory Usage 1,903KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (4)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete