Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Sies] [NEW PLUGIN] GoogleMapByCat v1

Quote Reply
Re: [Sies] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Try linking this in link.html;

Code:
<a href="javascript:void(0)" onclick="window.open('<%config.db_cgi_url%>/page.cgi?p=google_map;ID=<%ID%>','map','width=300,height=200,menubar=yes,status=yes,location=yes,toolbar=yes,scrollbars=yes')">View Map</a>

..then, make a new template called "google_map.html". Put the following code in it:

Code:
<%load_link_details($ID)%>
<html>
<head>
<title>Map for <%Title%></title>
<body>
<%Plugins::GoogleMap::LoadMap($ID)%>

<%-- START GOOGLE MAP STUFF --%>

<%if LongVal%>

<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2.x&key=<%API_Key%>"></script>

<style>.gmap {
margin: 0px;
padding: 0px;
}

.middleColumn {
margin: 0px;
padding: 0px;
}</style>

<div align="center" style="padding: 10px 10px 10px 10px;">

<div id="ForumMembers_mapdisplay" style="width: 500px; height: 300px" class="gmap display"></div>

</div>

<script type="text/javascript">

//<![CDATA[

if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("ForumMembers_mapdisplay"));
var center = new GLatLng(<%LatVal%>,<%LongVal%>);

map.setCenter(center, 15);
map.enableContinuousZoom();
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());


m0 = new GMarker(new GLatLng(<%LatVal%>,<%LongVal%>));
GEvent.addListener(m0, "click", function() {
m0.openInfoWindowHtml("<h2>fff</h2>");
});
map.addOverlay(m0);

}
else {
alert("Your browser is not compatible with the mapping tool.");
}
//]]>
</script>

<%endif%>

<%-- END GOOGLE MAP STUFF --%>
</body>
</html>

Now, you need to make a new global - called "load_link_details", with the following code:

Code:
sub {
my $link = $DB->table('Links')->select( { ID => $_[0] } )->fetchrow_hashref;
return $link;
}

Hopefully that'll do the trick Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread; hot thread [NEW PLUGIN] GoogleMapByCat v1 Andy 24400 Aug 26, 2008, 3:11 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Piers1 23303 Sep 17, 2008, 5:36 AM
Thread; hot thread Re: [Piers1] [NEW PLUGIN] GoogleMapByCat v1
Andy 23353 Sep 17, 2008, 5:58 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Sies 23269 Oct 16, 2008, 5:55 AM
Thread; hot thread Re: [Sies] [NEW PLUGIN] GoogleMapByCat v1
Andy 23297 Oct 16, 2008, 6:08 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Sies 23285 Oct 16, 2008, 11:57 AM
Post; hot thread Re: [Sies] [NEW PLUGIN] GoogleMapByCat v1
Andy 23222 Oct 16, 2008, 11:13 PM
Thread; hot thread Re: [Piers1] [NEW PLUGIN] GoogleMapByCat v1
colintho 25840 Nov 4, 2008, 9:20 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Piers1 25930 Nov 4, 2008, 9:40 AM
Thread; hot thread Re: [Piers1] [NEW PLUGIN] GoogleMapByCat v1
colintho 25760 Nov 4, 2008, 10:16 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 25810 Nov 4, 2008, 11:59 PM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Jesus 25614 Aug 5, 2009, 8:18 AM
Post; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1
Andy 25548 Aug 5, 2009, 10:00 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1
Andy 25592 Aug 5, 2009, 11:14 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Jesus 25720 Aug 5, 2009, 11:47 AM
Post; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1
Andy 25506 Aug 6, 2009, 1:24 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1
Andy 25601 Aug 7, 2009, 3:59 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 25521 Aug 7, 2009, 8:07 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 25487 Aug 8, 2009, 4:59 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 25569 Aug 12, 2009, 3:52 PM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 25530 Aug 13, 2009, 12:02 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 25549 Aug 13, 2009, 8:02 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 25461 Aug 13, 2009, 8:46 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 25518 Aug 13, 2009, 9:24 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 25508 Aug 13, 2009, 10:14 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 25384 Aug 13, 2009, 11:31 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 25552 Aug 14, 2009, 1:22 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17438 Aug 14, 2009, 8:24 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17394 Aug 14, 2009, 8:39 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17398 Aug 14, 2009, 8:44 AM
Post; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17306 Aug 14, 2009, 9:41 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
VishalT 17402 Aug 14, 2009, 9:07 AM
Thread; hot thread Re: [SWDevil.Com] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17458 Aug 14, 2009, 9:42 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17489 Aug 14, 2009, 10:30 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17423 Aug 14, 2009, 10:46 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17388 Aug 14, 2009, 10:54 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17351 Aug 17, 2009, 8:08 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17328 Aug 17, 2009, 8:19 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17329 Aug 17, 2009, 8:28 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17281 Aug 17, 2009, 9:00 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17320 Aug 17, 2009, 9:28 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17321 Aug 17, 2009, 9:32 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17282 Aug 17, 2009, 9:46 AM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 17323 Aug 17, 2009, 10:25 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 17440 Aug 17, 2009, 10:41 PM
Thread; hot thread Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk
Andy 16831 Feb 12, 2011, 5:07 AM
Post; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk
Jesus 16668 Feb 12, 2011, 8:17 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23344 Oct 27, 2008, 1:37 AM
Post; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23263 Oct 27, 2008, 1:41 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23239 Oct 27, 2008, 1:54 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23222 Oct 27, 2008, 2:06 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23246 Oct 27, 2008, 2:14 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23240 Oct 27, 2008, 2:37 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23285 Oct 27, 2008, 2:48 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23362 Oct 27, 2008, 3:06 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23215 Oct 27, 2008, 3:07 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23236 Oct 27, 2008, 3:37 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23276 Oct 27, 2008, 4:04 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Andy 23234 Oct 27, 2008, 4:33 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23252 Oct 27, 2008, 5:35 AM
Post; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23222 Oct 27, 2008, 6:13 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23274 Oct 27, 2008, 6:30 AM
Post; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 25808 Oct 27, 2008, 8:00 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 25889 Oct 28, 2008, 3:15 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 25870 Oct 28, 2008, 3:22 AM
Post; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 25801 Oct 28, 2008, 4:09 AM
Post; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
Andy 25813 Nov 4, 2008, 1:13 AM
Thread; hot thread Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1
colintho 23299 Oct 27, 2008, 6:00 AM
Thread; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
colintho 23224 Oct 27, 2008, 6:07 AM
Post; hot thread Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1
Andy 23149 Oct 27, 2008, 6:13 AM