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
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!