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

[NEW PLUGIN] GoogleMapByCat v1

Quote Reply
[NEW PLUGIN] GoogleMapByCat v1
Hi,

I'm pleased to announce the release over GoogleMapByCat Smile

More details: http://www.ultranerds.com/...GoogleMapByCat_L264/

Price: $50

This is also part of the ULTRA Package PRO deal.

Whats this plugin do?

This plugin will let you show a map of the links in your category, assuming they have an address set for their listing. NOTE: This plugin requires the GoogleMap plugin, as that is where the long/lat values are grabbed from. This simply adds an extention to that plugin, so you can show the map on your category pages.

Features

  1. Very simple to setup
  2. Lets you show the map on ANY category page (you can enable/disable specific categories, if the list is too long - as that can sometimes slow down your users download times)
  3. You can set custom long/lat location per category, as well as the zoom level (this is handy, if your categories are country related - as you can zoom in at different levels per category, on different locations)
Screenshots

There is an example screenshot here: http://www.ultranerds.com/...GoogleMapByCat_L264/

If you have any questions, please don't hesitate to ask.

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi Andy,

I'm having fun with this. I've now got a nice hover effect working on the markers based on this example;
http://econym.googlepages.com/mouseo.htm

If anybody is interested, this plugin is proving very popular with my users and can be seen working here;
Stagelink Scenery Suppliers

Cheers,

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

Glad to hear its working well for you :)

Quote:
I'm having fun with this. I've now got a nice hover effect working on the markers based on this example;
http://econym.googlepages.com/mouseo.htm

Ah cool - its a little bit of a PITA when you have to actually "click" on a flag with the current system, to make it show the box. Hopefully that'll work well for people if they use it 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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
How do I put an individual GoogleMap popup link for each listing in the links.html page?
Quote Reply
Re: [Sies] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

What do you mean? A link in link.html, which makes a pop-up box appear, with the google map in it?

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I want a link like this
http://econym.googlepages.com/mouseo.htm
I want to place it next to a linkowners address, so a user can click this link a view a GoogleMap with a marker for only that address.
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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I've added this to my site but cant seem to get it working correctly:

If I add Lat /Long coordiantes + zoom level for UK, the map appears to default to a location showing 'blue' with a location somewhere in the Indian ocean?

I've tried various lat / long coordinates but they make no difference?

any help /advice please?

PS. I like the 'mouse over' effect implemented by Piers1
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

I'm actually working on a function ATM, which will let you enter an address, and get a long/lat value returned.

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!
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Please try version 1.1, which is now available from our Members Area.

It has a new function in the admin panel, called "Find a long/lat for place". In your example, enter "Scotland", and it should get the correct values for you (you will most likely wanna play around with the zoom level, as the long/lat value you will get, will be for pretty much the center of scotland =))

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I've installed v1.1 and used the tool to get these lat / long for Scotland:

Long: -4.2026459999999997
Lat: 56.490670999999999

I've modified the scotland category using these + zoom level of 14

The map still shows 'indian ocean' when viewing the scotland category page
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Sorry, my mistake. I put the long/lat values back to front. If you reversed those values, then that would be the correct place =)

I've just uploaded a fixed version (still 1.1), and that can be downloaded from the Members Area. I've also updated the "Scotland" category for you, and its all showing fine now. NB: I wouldn't use that level of zoom, as thats aimed at REALLY zooming in (i.e street level, not a whole country =))

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Do I need to upload the 'revised' v1.1 plugin or did you upload it to my site?
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
You will need to =)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
OK, uploaded new v1.1

Appears to work OK, just 1 comment: I used the lat / long tool to get co-ordinates for Bodmin, Cornwall

Long: 50.471296000000002
Lat: -4.7176130000000001

It gave the correct lat long but with 'labels' mixed wrong way round...the correct labeling would be:

Lat: 50.471296000000002
Long: -4.7176130000000001

It works ok if you 'follow' the values + labels, exactly as shown

But if somebody else using this plugin doesnt know about this labelling it opens up the possibility for confusion.

Is this easily changed in your plugin as it might prevent others asking about this in the future?
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Sorry, not sure what you mean?

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
The labels are 'wrong way round', its ok if you know they are or if you are not familiar with Lat / Long coordinates...and just use the plugin without question...but if you know about Lat / Long, and start using this plugin, 'without prior knowledge' of the way this plugin is labeling Lat / Long then it might cause a little confusion for 'new users'

This is just a quick reminder for anybody regarding Lat / Long.

Latitude is the term / label for the measurement system used when used for cooridinates, this is measured in degrees from the equator.

The equator is 0 degrees, any line of latitiude North or South of the equator is given a + or - value: UK mainland range from 50.000 upto 58.65

John O'Grotas Scotland = 58.64, -3.08
Lizard, Cornwall = 49.98,-5.20

Longitude: this is the term / label for the measurement system used when used for cooridinates, this is measured in degrees from Grenwich (London)

Grenwich is 0 degrees, any line of longitude East or Westof the equator is given a + or - value: UK mainland locations range from: 1.74 to -5.20


regards
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Ok, I see what you mean now. Will check it out later.

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I've uploaded a new version of 1.1 to the Members Area. This should have the "mix up" of the long/lat values sorted now (you will need to install this new version, *as well* as updating some bits in your templates (as per the readme)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Andy

some of the 'google maps' are not showing correct location:

see this example: http://www.bookbedandbreakfast.com/...e/Annaclone_147.html

I've tried variations of the address in the database fields, but they all return the 'US location' seen in the example.

Any ideas.

thanks
Colin Thompson
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
New version of GoogleMapsByCat

you refer to: " updating some bits in your templates (as per the readme) "

I've downloaded from members area, then uploaded to my site, then installed and checked the 'read me' but couldnt see any 'changes' for the templates;

previous code for category.html:

<%if GoogleLong and GoogleLat and GoogleMapZoom%>
<%Plugins::GoogleMapForCat::Get_Map_Details($category_id,$GoogleLat,$GoogleLong,$GoogleMapZoom)%>
<%endif%>

This is the code from revised 'read me' file:

<%if GoogleLong and GoogleLat and GoogleMapZoom%>
<%Plugins::GoogleMapForCat::Get_Map_Details($category_id,$GoogleLat,$GoogleLong,$GoogleMapZoom)%>
<%endif%>

I cant see any changes?

Do I need to change anything?

regards
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I've just added lat / long to Padstow category: http://www.bookbedandbreakfast.com/...l/Padstow/index.html

I didnt make any changes to the 'category' template, appears to work ok.

do I need to make any changes?
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Sorry, my mistake - no changes needed in category.html :)

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!
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
colintho wrote:
Andy

some of the 'google maps' are not showing correct location:

see this example: http://www.bookbedandbreakfast.com/...e/Annaclone_147.html

I've tried variations of the address in the database fields, but they all return the 'US location' seen in the example.

Any ideas.

thanks

I'll check into that in a bit.

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!
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
colintho wrote:
Andy

some of the 'google maps' are not showing correct location:

see this example: http://www.bookbedandbreakfast.com/...e/Annaclone_147.html

I've tried variations of the address in the database fields, but they all return the 'US location' seen in the example.

Any ideas.

thanks
Hi,

The problem seems to be more with your address =) If you open Google Earth, and enter:

Marine Drive, Hannafore, Cornwall, PL13 2DH, England

..it doesn't find it, but it does come up with:

Hannafore Rd, Looe, Cornwall PL13, UK
..and:
Hannafore Ln, Looe, Cornwall PL13, UK

You need to just update the address accordingly, as I have now done for you (I've set it as Hannafore Rd, Looe, Cornwall PL13, UK, so just change to "Hannafore Ln", if I selected the wrong one =))

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Andy

many thanks for that.

regards
Colin Thompson
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Andy

I've noticed that some address's that I have for listings do not work, no matter how I try?

eg. http://www.bookbedandbreakfast.com/...r/Ridgeview_619.html

I've different variations of the address:

Ridgeview, Scoresdown, Lynton EX35 6LJ
Scoresdown Farm, Lynton EX35 6LJ

With this situation is there any 'work around' to use 'lat / long' co-ordinates?

Lat: 51.2058
Long: -3.8113

Thanks
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

You could just try manually adding it into the glinks_GoogleMaps table, with the co-ordinates you gave. I may add in something, so that you can manually add an entry for a link too, as I'd imagine there may be a few people that would like that feature. Gotta pop into town now though, as my cars got some problems, and I need to go get them sorted :(

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
This 'quick' work around is OK if you want to use 'precise' co-ordinates for the location map on the DETAILED page, as sometimes the ZIP / postcode will only provide a general location marker.

By adding Latitude + Longitude fields to the Links properties table, which can be used for manually adding location co-ordinates. Then editing / adding some extra code to the 'Google Maps' code that goes into the detailed.html page.

This only works for the DETAILED page and will not effect / update the 'category' map, this will still use the location co-ordinates from the address fields.

NOTE: the Plugin "GoogleMap" has a tool to 'refresh' the lat / long' co-ordinates, using the link labelled "Delete a Links long/lat values" - this will then 'grab' the new data during next build.

<%-- 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 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(<%if Latitude%><%Latitude%><%else%><%LatVal%><%endif%>,<%if Longitude%><%Longitude%><%else%><%LongVal%><%endif%>);

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

m0 = new GMarker(new GLatLng(<%if Latitude%><%Latitude%><%else%><%LatVal%><%endif%>,<%if Longitude%><%Longitude%><%else%><%LongVal%><%endif%>));
GEvent.addListener(m0, "click", function() {
m0.openInfoWindowHtml("<h2><%Title%></h2>");
});
map.addOverlay(m0);

}
else {
alert("Your browser is not compatible with the mapping tool.");
}
//]]>
</script>
<%endif%>
<%-- END GOOGLE MAP STUFF --%>


As a quick work around, this appears to work
Colin Thompson

Last edited by:

colintho: Oct 28, 2008, 4:31 AM
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

Version 1.2 is now available from the Members Area.

This has a fix in it, to combat the issue where the maps were going funky (markers not showing, zoom level box messed up etc). Please anyone who uses this plugin, upgrade to this version (just upload, install and voila)

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!
Quote Reply
Re: [Piers1] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hello Piers

did you get the 'hover effect' working within GoogleMapforCat ?

which part did you edit to get that working?
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi there Colin,

Here is an example from my live site of the hover effect;
Stagelink.com UK Trucking

However I had to directly edit Andy's code in GoogleMapForCat.pm to get this to work. I am using the original version, which will now not be the current version.
I would recommend looking at the site I referenced first and copying their source code and then working out which bits to swop out with Andy's code.
This not really recommended as the plugin will break if you upgrade the plugin at a later time.

Cheers,

Piers
Quote Reply
Re: [Piers1] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Thanks for the info.

This is such a great plugin, I'd rather not mess with the 'plugin code' (my skills dont go that far)

Would be really good if Andy adds this function (mouseover effect) to the plugin at some point in the future when workload permits?

Perhaps there could be an option: 'clickable marker' or 'mouseover marker'?

option to add 'text' to the InfoWindowHtml

option for the category map to show 'links' or 'sub-categories' or both?

Andy, keep up the great work.

regards
Colin Thompson
Quote Reply
Re: [colintho] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

I'll try and get it added in as an option. Still pretty busy =)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi Andy,

Is it possible to have different icons for the markers? I'll like to have red and blue balloons for my icons so probably we can add a new field for each site where we can upload their icon, do you think that's possible?

Thanks for this nice plugin :)

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

Mmm.. not sure. The code I use for this plugin was just something I found on another site (showing you how to use it), so wouldn't know really how to assign a different marker image for each one - I'll post something on their support group, and see if anyone can point me in the direction.

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!
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi,

I found some code so that the red icon can be changed to a different color, for each link - however, its not a simple case of just editing the script, so would need some custom work. regarding uploading a custom icon, I'm not sure how we could do that though :(

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Hi Andy,

I just got an idea... lets see if this can be done ;)

I have this code:

Code:
var iconMark = new GIcon(G_DEFAULT_ICON);
iconMark.image = <%IconUpload%>;
var iconMarksize = new GSize(38,42);
iconMark.iconSize = iconMarksize;

Which help us have custom icons per Marker. Now as you can see I think we need to create a new field on the database (IconUpload) and then just add the code to the plugin, I think this could be done.

When you use your own icon for the marker you have something like this:

Code:
function addtag(point, address) {
var marker = new GMarker(point, iconMark);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(address); } );
return marker;
}
var point = new GLatLng($article.m_lat$,$article.m_lon$);
var address = '<%PointAddress%>';
var marker = addtag(point, address, iconMark);
map.addOverlay(marker);

I think I'm also covering here another point to add the address to the same point as someone else asked before using the PointAddress variable (that can be also add it to the GLinks db, as we're doing it with the IconUpload).

Now as per your pluign code, I'm seeing this (around line 197):

Code:
$back .= qq|
var iconMark = new GIcon(G_DEFAULT_ICON);
iconMark.image = $link->{IconMark};
var iconMarksize = new GSize(38,42);
iconMark.iconSize = iconMarksize;

function addtag(point, address) {
m$i = new GMarker(new GLatLng($lat,$long));
GEvent.addListener(m$i, "click", function() {
m$i.openInfoWindowHtml('<h2>$link->{Title}<h2><br/>Address:$link->{PointAddress}<p><a href=\"$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}\">Ir al sitio</a></p>');
});
return m$i;
}
var point = new GLatLng($lat,$long);
var address = '$link->{PointAddress}';
var marker = addtag(point, address, iconMark);
map.addOverlay(m$i);
}
|;

I dont know if something like this might work, but I think I'm close enough, I think we need to add a couple of fields to the db (marker icon upload and marker address) and then add the code modifications, what do you think?

Jesus

PS
I write the code as I was thinking and typing so it might have some errors :p but i think that could be the idea.
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1 In reply to
I'll try and have a look - but I'm actually on vacation this week - so not doing much work ;)

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!
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1 In reply to
Ok, preliminary I've got it working - http://gossamerlinks.com/...UK%2Findex.html;d=1l

Here are the changes you need to make into /Plugins/GoogleMapForCat.pm:

find:

Code:
} else {
alert("Your browser is not compatible with the mapping tool.");
}

..and add this below it:

Code:
function addtag(point, address, iconimage, thelink) {


var iconMark = new GIcon(G_DEFAULT_ICON);
iconMark.image = iconimage;
var iconMarksize = new GSize(38,42);
iconMark.iconSize = iconMarksize;


var marker = new GMarker(point, iconMark);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(address + "<br><br><a href='" + thelink + "'>View More</a>"); } );
return marker;
}

Then find:

Code:
if ($CFG->{build_detailed}) {

my $detailed_url = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $hit->{LinkID} );

$back .= qq| m$i = new GMarker(new GLatLng($lat,$long));
GEvent.addListener(m$i, "click", function() {
m$i.openInfoWindowHtml('<h2>$link->{Title}<h2><p><a href=\"$detailed_url\">Click to view details</a></p>');
});
map.addOverlay(m$i);
|;

} else {


$back .= qq| m$i = new GMarker(new GLatLng($lat,$long));
GEvent.addListener(m$i, "click", function() {
m$i.openInfoWindowHtml('<h2>$link->{Title}<h2><p><a href=\"$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}\">Click to goto their site</a></p>');
});
map.addOverlay(m$i);
|;


}

..and change to:

Code:
my $address = qq|$link->{Address1}, $link->{City}, $link->{State}, $link->{ZIP}, $link->{Country}|;

$link->{MapMarkerImage} || = "http://maps.google.com/mapfiles/ms/micons/blue-dot.png";

if ($CFG->{build_detailed}) {

my $detailed_url = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $hit->{LinkID} );

# $back .= qq| m$i = new GMarker(new GLatLng($lat,$long));
# GEvent.addListener(m$i, "click", function() {
# m$i.openInfoWindowHtml('<h2>$link->{Title}<h2><p><a href=\"$detailed_url\">Click to view details</a></p>');
# });
# map.addOverlay(m$i);
# |;
$back .= qq|

var point = new GLatLng("$lat","$long");
var marker = addtag(point, "$address","$link->{MapMarkerImage}","$detailed_url");
map.addOverlay(marker);
|;


} else {


# $back .= qq| m$i = new GMarker(new GLatLng($lat,$long));
# GEvent.addListener(m$i, "click", function() {
# m$i.openInfoWindowHtml('<h2>$link->{Title}<h2><p><a href=\"$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}\">Click to goto their site</a></p>');
# });
# map.addOverlay(m$i);
# |;

$back .= qq|

var point = new GLatLng("$lat","$long");
var marker = addtag(point, "$address","$link->{MapMarkerImage}","$CFG->{db_cgi_url}/jump.cgi?ID=$link->{ID}");
map.addOverlay(marker);
|;


}

You need to then also add a new field to the "Links" table, called "MapMarkerImage" .. this setup should work:

Name: MapMarkerImage
Type: CHAR
Size: 255
Form type: TEXT

That should do the trick.

If you want to make sure people don't upload too big images - then you may wanna also pass that field through the Thumb_Images (or Thumb_Images_GD) plugin, so it shrinks it down to a size that will look good on the map)

I hope you appreciate this - as I've just spent a good part of 1 1/2 hours of my last day of vacation doing this for you Wink

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thank you Andy, I really appreciate your work specially when you're on vacation. I hope this can help many others as I truly beleive that maps its a must on all directories.

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

Ok, I've now made this an official release (thought I may as well, seeing as I spent so long making the changes =))

It works a little different to the above modification. Basically, a new field is added, and a set of 29 different icons. People can then select one of those icons to show - thus giving the map a bit more of a unique feel (instead of just simple red "markers")

Version 1.5 is now available from the Download Area on our site.

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi Andy,

I donwload the new plugin version from your site and now i'm not seeing the markers, also I'm not seeing those default markers you mention. I downloaded the new version as I'll like to have the latest version of the plugin. Will you help me?

Thanks
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
What version do you now have?

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi Andy,

Version: 3.0.4 and Plugin Version 1.5

Jesus


Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

Can you email me GLinks admin details, so I can have a look at how you have it setup?

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Sure Andy, email on its way.

Thanks for looking.

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

The problem was due to you not having the right fields in your Links table (you were missing Address1, Address2, City, State, ZIP and Country). I've added these, and also fixed up an issue with the marker image field already being used (from the last modification I suggested to you before). All looks good now :)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thanks for checking Andy,

A few questions... On the previous version you used long/lat in order to put those values per link on the Plugins page, are those values still need it? I'll like to use it in order to display properly the icon on the map.

Also, I noticed that you adjust the field for the markers so now I can select from those default icon markers, is it possible to have an extra field so I can upload custom icon markers if I need it and then have an if statment on the page so, if its custom marker use mine or if not then use the default marker icon selected?

Thanks again for helping me with this issue, I'll enjoy a lot using it once I get it right.

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
You really don't like making my job easy, huh? LOL Whistle

Ok, all done.

I changed:

Code:
if ($link->{MapMarkerImage}) {
$link->{MapMarkerImage} = qq|$CFG->{build_static_url}/icons/$link->{MapMarkerImage}.png|;
}

..to:

Code:
if ($link->{MapMarkerImageUpload}) {
$link->{MapMarkerImage} = Get_Image_URL($link->{ID},"MapMarkerImageUpload");
} elsif ($link->{MapMarkerImage}) {
$link->{MapMarkerImage} = qq|$CFG->{build_static_url}/icons/$link->{MapMarkerImage}.png|;
}

Then added this new function to the bottom of the plugin file:

Code:
# Get_Image_URL(ID,Field)
sub Get_Image_URL {
# -------------------------------------------------------------------
# Call with <%global_name($ID,'FieldName')%>
# NOTE: This is for the CATEGORY images...

my ($ID,$field,$table) = @_;

$table ||= 'Links';

# make sure a fieldname and ID are provided...
if (!$ID || !$field) { return "You need to define the ID and fieldname."; }

# get the actual path to where the file is/will be saved...
my $schema = $DB->table($table)->cols;
my $path = $schema->{$field}->{'file_save_url'};
$path =~ s,/$,,; # get rid of trailing / at end of $path

my $image_details = $DB->table($table."_Files")->select( { ForeignColName => $field, ForeignColKey => $ID } )->fetchrow_hashref;

my $id = $image_details->{ID};
my $filename = $image_details->{File_Name};
my $file_url = $image_details->{File_URL}; # this is only the URL/folder

my @cut = split //, $id;
my $folderid = $cut[$#cut];

my $url = "$file_url/$folderid/$id-$filename";


$url =~ s|([^\/]+)$|GT::CGI->escape( $1 )|e;

return $url;

}

..and finally added a new field to your Links table, called "MapMarkerImageUpload", type: CHAR(255), form_type => FILE , and then set the file_save_url and file_save_path to a folder on your server.


Quote:
A few questions... On the previous version you used long/lat in order to put those values per link on the Plugins page, are those values still need it? I'll like to use it in order to display properly the icon on the map.

Yup, these are still used:

Code:
var point = new GLatLng("25.7208","-100.2379");
var marker = addtag(point, "7-minilogo.gif<br/>,<h2>Con-Air</h2>,Reales No. 201, San Nicolas de los Garza, Nuevo Leon, 66476, Mexico","http://maps.google.com/mapfiles/ms/micons/blue-dot.png","http://www.domain.com/cgi-bin/directorio/jump.cgi?ID=2323");
map.addOverlay(marker);

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
WOW, thank you so much Andy, the upload marker function worked great!

One last thing, will you mind to share with me where should I add the long/lat values to the links now? On the previous version there was a link on the GoogleMap plugin options on the plugin page where I was able to add those values, I'm not seeing that option on that page or on the links table, will you share with me where should I add those values?

Thanks again for all your help, this plugin its great!

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

To manually add an address, you can add it via MySQLMan, in the glinksl_GoogleMaps table (or lsql_GoogleMaps, in your case)

Please note, you also need to update the Address1, City, State, ZIP and Country fields in the Links table too.

I may at some point add a feature in the admin, where you can add these details direct from the admin area - but don't have time atm :)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
ok, so the new version doesnt have those 2 fields lat/long, and with just the address it will give you the proper lat/long values to be used on the map, Am I correct?

As I dont want to write any value directly to the database, I'll use for everything just the proper tools from the admin, I just want to make sure thise 2 values (lat/long) should be filled properly.

Jesus
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hey Andy,

I was wondering if GoogleMapbyCat has this feature:

# Only selected links will be displayed on the map.

Or an ability where admin can setup something like display on map type link property and using if/elseif can display only those links which are selected to be displayed by a marker in the map.

Vishal
-------------------------------------------------------
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

No, the new version does have those fields - BUT, they are stored in the Long/Lat field in the GoogleMap table.

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!
Quote Reply
Re: [SWDevil.Com] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

Its not hard to add a little bit of code in that will let you add a new field, and then have a Yes/No value, to decide if it is shown on the map.

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
As soon as I finish the upgrade I'm doing it will try to finish this task and get this plugin working ;)

I think this its a must as I already tried to add another place on a map and as I'm not able to put the lat/long for that link id (I put all the address), the marker its not showing on the map, so the only markers showing on the maps are the ones I was able to put lat/long on the previous plugin version. Will check into this once I finish the update im working with.
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

To make them show up, check out the documentation in the GoogleMap plugin - and look at what goes into detailed.html. This auto-inserts the long/lat/address values for you, but only once the detailed page is built (for static sites), or accessed via mod_rewrite/page.cgi

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
I think the table we need to have access to make the proper adjustments its: lsql_GoogleMaps, that was the table I was refering before. I'll think about how to make this thing possible.

Thanks Andy! ;)
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi Andy,

One question... Do u think its possible to install again the Google Map plugin without affectin what you did on the GoogleMapByCat plugin? As that's the plugin who has access to the lsql_GoogleMaps table in order to put those values (lat/long) per each site.

Thanks,

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

Afraid not - I'll see if I can come up with something for you, so you can manually add the values in (not sure when I'll be able to do that - either later today, or maybe later this week)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thank you Andy,

As those 2 values are extremely important as those are the ones who permit to display the mark on the category map. Thanks again,

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

Is the attached image the kind of thing you are looking for ? (as a plugin option, in the admin area)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Yes, you're correct!

Jesus
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Ok, will see what I can come up with. In middle of another job atm though =)

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thanks!
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Version 1.6 is now available from the Members Area.

This also include the option that you have, where a marker image can be uploaded to a link (so you can simply upload the new version, install it - and it should work fine :))

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thank you Andy!
Quote Reply
Re: [Jesus] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Hi,

I've just uploaded version 2.0 of this plugin. This includes several new features/changes, and a bug fix:

1) The way the links are "selected" is all now done in a single query - instead of loading all the links in the given category, and only showing validated/paid listings
2) You now have the option to show paid listings, or both
3) I've added a "cluster" feature, which will make the page load quicker when you have a lot of markers on your map. For example, if you have 50 markers, then it will show an "arrow", which will then in turn (when clicked), zoom in on the map, and show you all the listings in that marker).

You can see an example of the marker system here: http://googlemapsapi.martinpearman.co.uk/...aps_api.php?map_id=4

4) There was a little bug, which was showing the free listings as well (instead of just paid ones). This bug is now fixed up (and also as stated above, you can now decide if you wanna show paid listings only, or both)

The new version can be downloaded for GLinks 3.2 form the Members Area on our site.

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!
Quote Reply
Re: [Andy] [NEW PLUGIN] GoogleMapByCat v1nk In reply to
Thank you Andy, I'll install the update next week :)

Nice features btw ;)

Jesus