Quote from: AK-74U at Aug 04, 2008, 02:12 PM
Anybody knows how to use different markers on one map for? There’s no way to use TV call from snippet (instead getTemplateVar, but this will return TV from page, where snippet was called...)
Help me, please.
P.S. Sorry for my bad English...
The line numbers in this post matches the snippet code of
this posts. So get that snippet as base.
Then go to line 262, where you find the following:
function createMarker(point,name,html) {
change that to:
function createMarker(point,name,html,iconurl) {
Then paste the following starting from line 263:
// Create our custom marker icon
var icon = new GIcon();
icon.image = iconurl;
icon.shadow = "";
icon.iconSize = new GSize(20, 35);
icon.shadowSize = new GSize(29, 18);
icon.iconAnchor = new GPoint(10, 15);
icon.infoWindowAnchor = new GPoint(5, 1);
Then in line 271, replace:
var marker = new GMarker(point);';
with:
var marker = new GMarker(point,icon);';
Then in line 316, find the part:
var marker = createMarker(point, \'[+title:slashandstrip+]\', \'[+content:slashandstrip+]\');
and replace that part with:
var marker = createMarker(point, \'[+pagetitle:slashandstrip+]\', \'[+content:slashandstrip+]\', \'[+longtitle:slashandstrip+]\');
That should be it.. Now you can set the url of the icon you want to the marker to the "longtitle" field of a document. Didn’t test it though...
You can also change all those fields in to TVs if you want. The description field is on the same line 316 used to make the point, you can change all those to TV fields if you like.