Hi,
I made some try to obtain clickable markers.
First, I try to add an information window
NSString *script =
[NSString stringWithFormat:
@"var point = new GLatLng(%f, %f);"
"var marker = new GMarker(point);"
"map.addOverlay(marker);"
"marker.openInfoWindowHtml(\"<b>Coucou</b>, ici c'est Reykjavik
\");"
, latitude
, longitude];
[mapWebView evalJS:script];
So it works but informative window is already open. I tried this
(replaced openInfoWindowHtml by bindInfoWindowHtml
NSString *script =
[NSString stringWithFormat:
@"var point = new GLatLng(%f, %f);"
"var marker = new GMarker(point);"
"map.addOverlay(marker);"
"marker.bindInfoWindowHtml(\"<b>Coucou</b>, ici c'est Reykjavik
\");"
, latitude
, longitude];
[mapWebView evalJS:script];
But it does not work.
Finally I tryed this:
NSString *script =
[NSString stringWithFormat:
@"var point = new GLatLng(%f, %f);"
"var marker = new GMarker(point);"
"map.addOverlay(marker);"
"GEvent.addListener(marker, \"click\", function() {"
"marker.openInfoWindowHtml(\"<b>Coucou</b>, ici c'est Reykjavik
\");"
"});"
, latitude
, longitude];
[mapWebView evalJS:script];
It does not work neither. Maybe click on marker is ignored and I do
not know why.
Any help ?
Best regards,
Quentin
On Jan 9, 9:29 am, MrXino <
ni...@extremedesigns.nl> wrote:
> Does anybody has an idea about changing the code so pins can be opened
> (so additional information can be viewed)? For example a map like
> this:
http://code.google.com/intl/nl/apis/maps/documentation/examples/icon-...