Extension talk:Google Maps/Syntax

>> You can host your own collection of icons on your server, but note that they'll have the same >> anchor points as Google's default icon

Can someone tell how to exactly use custom icons? I have downloaded a set and have them in a folder on the site. Where does the icons attribute go?


 * I wanna know, too. See below.

how to use multiple icons?
Hi

Does anyone know how to use multiple icons? I want to use 4 different coloured icons to distinguish between the different locations on the map.

SoftDux 16:23, 23 March 2007 (UTC)

Try something like this:

 (H) 52.034277, 5.167522, Houten (O) 52.053321, 5.23972, Odijk Vic, 11:09, 12 June 2007 (UTC)

Thanx, that helped a bit :)

Now I just need to figure out how to get the icons to "auto display" when I hover over them, instead of having to click on each one


 * Have you found out how to autodisplay them? 09:12, 10 July 2007 (UTC) en:User:JanCK

my own icon set
You can host your own collection of icons on your server, but note that they'll have the same anchor points as Google's default icon.
 * What's that syntax for icons at my own server? I tried

(http://myserver.com/mypicture.gif) 52.053321, 5.23972, Odijk and http://myserver.com/mypicture.gif 52.053321, 5.23972, Odijk both didn't work. Maybe I may not use gifs, or a specific size is required? 09:12, 10 July 2007 (UTC) en:User:JanCK

I just had a look at the source code and I don't see how it could work. It first checks whether the line you wrote matches preg_match("/^(?:\(([.a-zA-Z0-9_-]*?)\) *)?([^,]+), *([^ ,]+)(?:, (.+))?/", $line, $matches)) Anyone familiar with RegExp? Would   (http://myserver.com/mypicture.gif) 52.053321, 5.23972, Odijk match this pattern? The other two alternatives, that are checked, are:  preg_match('/^\/([^\\\\]+)\\\\ *(.*)$/', $line, $matches)) for tabs and preg_match("/^(#[0-9a-fA-F]{6})/", $line, $matches)) for polygon lines. With $o = array("icons" => "http://maps.google.com/mapfiles/marker{label}.png",    "icon" => "http://www.google.com/mapfiles/marker.png",    ); It goes on:

$output .= googleMaps_AddMarker($lat, $lon, $icon, 'SMALLERTHANdiv style="direction: rtl;">'.$parsed->getText.'SMALLERTHAN/div>', $color, $tabs); $icon = $matches[1]; if ($icon && !$icons[$icon]) { // need to create this icon, since we haven't already $output .= " mapIcons['{$icon}'] = new GIcon(G_DEFAULT_ICON, '".addslashes(str_replace("{label}", $icon, $o['icons']))."');"; $icons[$icon] = true; } $output .= " marker = new GMarker(new GLatLng({$lat}, {$lon}), { 'icon':mapIcons['{$icon}'], 'clickable':false });";

solutions?
It seem to me that if ($icon && !$icons[$icon]) { // need to create this icon, since we haven't already $output .= " mapIcons['{$icon}'] = new GIcon(G_DEFAULT_ICON, '".addslashes(str_replace("{label}", $icon, $o['icons']))."');"; $icons[$icon] = true; } should be replaced with something like if (preg_match("/^([A-Z])/", $icon, $null) && !$icons[$icon]) { // need to create this icon, since we haven't already $output .= " mapIcons['{$icon}'] = new GIcon(G_DEFAULT_ICON, '".addslashes(str_replace("{label}", $icon, $o['icons']))."');"; $icons[$icon] = true; } elseif {   if (&icon && !$icons[$icon]) { // need to create this icon, since we haven't already $output .= " mapIcons['{$icon}'] = new GIcon(G_DEFAULT_ICON, '".addslashes($icon)."');"; $icons[$icon] = true; }  } But I haven't tried it, nor do I know whether an array allows an arbitrary string as indexing argument. 09:55, 10 July 2007 (UTC) en:User:JanCK

Furthermore, I guess the regular expression doesn't allow ://, so probably that's gotta be changed, too.

solution!
Oh, I think I got it! You are not supposed to mix your icons with googles icons. You specify icons="http://myserver.com/marker{label}.png" and icons="http://myserver.com/marker.png" into the googlemaps tag and you'll than only use your own icons. 10:07, 10 July 2007 (UTC) en:User:JanCK

how to print the map + direction and way points
Hi all,

if i print an page with a map + way points or direction on it, the map is ok but there is no direction or way point printed, what do?

Tx

-