Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 User Map with XThreads?
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #21
RE: User Map with XThreads?
(08-31-2011 09:43 AM)x-Treme Wrote:  So we don't need an api key for this? Seems I can remember having to get one for the old plugin (but that was years ago).
Yes, we don't need an API Key for the newest version (Google Maps JavaScript API Version 3).

(08-31-2011 08:28 PM)RocketFoot Wrote:  Would it be possible to link the member's username to the tooltip so when you run your mouse over a pin, it will show the member's username instead of thread title?
Edit the Display Format of the Geo Location custom thread field. Find:

Code:
title:"{$thread['subject']}"

Replace it with:

Code:
title:"{$thread['username']}"


(09-01-2011 12:37 AM)RocketFoot Wrote:  Or, would it be possible to make the balloon pop open on mouse roll over?
We can assign a mouseover instead click for that (located in the Display Format of the Geo Location custom thread field).

Example:
Edit the Display Format of the Geo Location custom thread field. Find:

Code:
google.maps.event.addListener(marker{$thread['tid']}, 'click', function() {


Replace the click with mouseover.

Here is another example for the mouse event:
Display Format of the Geo Location custom thread field:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<if THIS_SCRIPT != 'forumdisplay.php' then>{VALUE}</if><setvar umap_title>$thread['uid'] ? '<div><strong><a href=\"'.get_profile_link($thread['uid']).'\">'.$thread['username'].'</a>, <a href=\"'.$threadurl.'\">'.$thread['subject'].'</a></strong></div><div class=\"smalltext\"><em>Pinned: '.$thread['threaddate'].', '.$thread['threadtime'].'</em></div>' : '<div><strong>'.htmlspecialchars_uni($mybb->user['username']).', '.htmlspecialchars_uni($mybb->input['subject']).'</strong></div><div class=\"smalltext\"><em>Pinned: '.my_date($mybb->settings['dateformat'], TIME_NOW).', '.my_date($mybb->settings['timeformat'], TIME_NOW).'</em></div>'</setvar><setvar map_msg>'<div><div class=\"float_left\" style=\"margin: 5px;\">'.$GLOBALS['threadfields']['umap_img']['value'].'</div>'.$tplvars['umap_title'].'<br />'.$GLOBALS['threadfields']['umap_desc'].'</div>'</setvar><setvar mymarker>$mybb->user['uid'] ? '<a href="'.$forumurl_q.'filterxt_uid='.intval($mybb->user['uid']).'">Where is my marker?</a>' : ''</setvar><if THIS_SCRIPT == 'forumdisplay.php' then>
var myLatlng{$thread['tid']} = new google.maps.LatLng{VALUE};
var marker{$thread['tid']} = new google.maps.Marker({
	position: myLatlng{$thread['tid']}, 
	map: map,
	title:"{$thread['subject']}"
});
var message{$thread['tid']} = "{$GLOBALS['tplvars']['map_msg']}";
var infowindow{$thread['tid']} = new google.maps.InfoWindow({
	content: message{$thread['tid']},
	size: new google.maps.Size(50,50)
});
google.maps.event.addListener(marker{$thread['tid']}, 'mouseover', function() {
	infowindow{$thread['tid']}.open(map,marker{$thread['tid']});
});
google.maps.event.addListener(marker{$thread['tid']}, 'mouseout', function() {
	infowindow{$thread['tid']}.close(map,marker{$thread['tid']});
});
google.maps.event.addListener(marker{$thread['tid']}, 'click', function() {
	window.location="{$threadurl}";
});
google.maps.event.addListener(marker{$thread['tid']}, 'rightclick', function() {
	map.setCenter(myLatlng{$thread['tid']});
	map.setZoom(9);
});</if>


Now, when a user mouseover a marker/pin, the balloon pop will be opened. The balloon pop will be closed when the marker/pin lose focus. Clicking a marker/pin will lead the user to the thread. Right clicking a marker/pin, will zoom in the map, and the map will be centered at the marker.
You can see it at the live demo:
http://xtest.byethost7.com/forumdisplay.php?fid=5
Try to mouseover, right click and click a marker (I've set the zoom level of the map in the showthread into a bigger value. It will make the thread author's location more "clearer").

I think I will update the example post using this method, because we still can use the thread for user discussions?


09-01-2011 03:28 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
User Map with XThreads? - RocketFoot - 08-28-2011, 10:41 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 08-28-2011, 11:11 AM
RE: User Map with XThreads? - RocketFoot - 08-29-2011, 10:27 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 08-29-2011, 11:41 AM
RE: User Map with XThreads? - RocketFoot - 08-29-2011, 08:41 PM
RE: User Map with XThreads? - RateU - 08-30-2011, 07:39 AM
RE: User Map with XThreads? - Shemo - 08-30-2011, 03:26 PM
RE: User Map with XThreads? - RocketFoot - 08-31-2011, 03:43 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 08-30-2011, 06:08 PM
RE: User Map with XThreads? - Shemo - 08-31-2011, 03:10 AM
RE: User Map with XThreads? - RateU - 08-31-2011, 08:16 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 08-31-2011, 08:40 AM
RE: User Map with XThreads? - RocketFoot - 08-31-2011, 09:28 AM
RE: User Map with XThreads? - x-Treme - 08-31-2011, 09:43 AM
RE: User Map with XThreads? - RocketFoot - 08-31-2011, 10:05 AM
RE: User Map with XThreads? - x-Treme - 08-31-2011, 10:22 AM
RE: User Map with XThreads? - RocketFoot - 08-31-2011, 10:58 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 08-31-2011, 12:20 PM
RE: User Map with XThreads? - RocketFoot - 08-31-2011, 08:28 PM
RE: User Map with XThreads? - RocketFoot - 09-01-2011, 12:37 AM
RE: User Map with XThreads? - RateU - 09-01-2011 03:28 AM
RE: User Map with XThreads? - RocketFoot - 09-01-2011, 05:59 AM
RE: User Map with XThreads? - RateU - 09-01-2011, 06:35 AM
RE: User Map with XThreads? - RocketFoot - 09-01-2011, 06:44 AM
RE: User Map with XThreads? - RocketFoot - 09-01-2011, 08:14 PM
RE: User Map with XThreads? - ZiNgA BuRgA - 09-01-2011, 10:06 PM
RE: User Map with XThreads? - RocketFoot - 09-02-2011, 03:04 AM
RE: User Map with XThreads? - ZiNgA BuRgA - 09-02-2011, 07:29 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 01:16 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 03:11 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 03:23 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 03:29 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 04:24 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 04:57 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 05:05 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 05:07 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 05:16 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 05:19 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 05:26 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 05:31 AM
RE: User Map with XThreads? - RateU - 09-03-2011, 05:42 AM
RE: User Map with XThreads? - RocketFoot - 09-03-2011, 05:49 AM
RE: User Map with XThreads? - RocketFoot - 10-21-2011, 05:34 AM
RE: User Map with XThreads? - RateU - 10-21-2011, 06:19 AM
RE: User Map with XThreads? - RocketFoot - 10-21-2011, 06:32 AM
RE: User Map with XThreads? - RateU - 12-27-2011, 06:19 AM
RE: User Map with XThreads? - Lkwmonster - 06-06-2012, 05:05 AM
RE: User Map with XThreads? - RateU - 06-06-2012, 05:10 AM
RE: User Map with XThreads? - Lkwmonster - 06-06-2012, 05:21 AM
RE: User Map with XThreads? - RateU - 06-06-2012, 06:03 AM
RE: User Map with XThreads? - meister-igi - 09-26-2012, 09:30 AM
RE: User Map with XThreads? - MrBrechreiz - 10-28-2012, 10:11 AM
RE: User Map with XThreads? - meister-igi - 10-30-2012, 10:32 AM
RE: User Map with XThreads? - Scott - 10-26-2012, 12:35 PM
RE: User Map with XThreads? - ZiNgA BuRgA - 10-26-2012, 05:15 PM
RE: User Map with XThreads? - RateU - 10-27-2012, 01:10 AM
RE: User Map with XThreads? - Scott - 10-27-2012, 07:25 AM
RE: User Map with XThreads? - RateU - 10-28-2012, 01:06 AM
RE: User Map with XThreads? - Scott - 10-28-2012, 03:12 AM
RE: User Map with XThreads? - RateU - 10-29-2012, 01:59 AM
RE: User Map with XThreads? - MrBrechreiz - 10-30-2012, 04:53 PM
RE: User Map with XThreads? - meister-igi - 10-31-2012, 12:39 PM
RE: User Map with XThreads? - MrBrechreiz - 10-31-2012, 06:55 PM
RE: User Map with XThreads? - meister-igi - 11-01-2012, 08:45 AM
RE: User Map with XThreads? - RateU - 11-03-2012, 03:07 AM
RE: User Map with XThreads? - admin2u - 12-17-2012, 06:42 PM
RE: User Map with XThreads? - ZiNgA BuRgA - 12-18-2012, 09:12 AM
RE: User Map with XThreads? - admin2u - 12-22-2012, 06:57 AM
RE: User Map with XThreads? - admin2u - 12-22-2012, 07:27 AM
RE: User Map with XThreads? - Scott - 12-23-2012, 12:42 PM
RE: User Map with XThreads? - RateU - 12-24-2012, 05:57 AM
RE: User Map with XThreads? - Scott - 12-26-2012, 07:46 AM
RE: User Map with XThreads? - Scott - 12-28-2012, 09:04 AM
RE: User Map with XThreads? - Traax - 02-22-2013, 04:47 AM
RE: User Map with XThreads? - MrBrechreiz - 02-22-2013, 12:41 PM
RE: User Map with XThreads? - Traax - 02-23-2013, 03:08 AM
RE: User Map with XThreads? - bigvin - 01-31-2014, 11:26 PM
RE: User Map with XThreads? - bigvin - 02-02-2014, 11:43 PM
RE: User Map with XThreads? - bigvin - 04-14-2015, 11:34 PM
RE: User Map with XThreads? - RocketFoot - 02-17-2017, 03:07 AM
RE: User Map with XThreads? - RocketFoot - 12-02-2017, 08:41 PM
RE: User Map with XThreads? - ZiNgA BuRgA - 02-10-2018, 11:07 PM
RE: User Map with XThreads? - lenox - 04-30-2018, 05:29 AM
RE: User Map with XThreads? - RateU - 05-01-2018, 10:45 PM
RE: User Map with XThreads? - crow - 05-02-2018, 02:21 AM
RE: User Map with XThreads? - RateU - 05-04-2018, 10:15 PM

 Standard Tools
Forum Jump: