views:

66

answers:

0

Ihave problem with google maps.
1st i open Gmap like someone already click on point: "map.openInfoWindowHtml(point, xhtml);" - that's ok
2nd in var xhtml i put link to "Get Directions" - that's ok
3rd i want: if someone click on link in "InfoWindow" to open iframe with FancyB, just like someone visit "http://maps.google.com/" and write only "End Point"
If i put link outside InfoBox all is OK, in iframe direction is opened, but problem is in InfoBox. If someone clik on link in InfoBox, browser redirect user to "http://maps.google.com/...xyz..."
I think i can somehow use .live in jquery
Here is some code:

$(document).ready(function() {
    $("#goog").fancybox({
            'width'                : '85%',
            'height'            : '85%',
            'autoScale'            : false,
            'transitionIn'        : 'none',
            'transitionOut'        : 'none',
            'type'                : 'iframe'
    });

});

var map = new GMap2(document.getElementById("map"));
var point = new GLatLng(44.113072, 15.226322);
center map on Science Center
map.setCenter(new GLatLng(44.113072, 15.226322), 17);
var typeControl = new GMapTypeControl();
map.addControl(typeControl);
var marker = new GMarker(point);
map.addOverlay(marker);
map.addControl(new GLargeMapControl());
map.enableScrollWheelZoom();
map.enableContinuousZoom();
var xhtml = "<b>Some text</b>";
xhtml += "<a id='goog' href='http://maps.google.com/maps?f=d&amp;amp;source=embed&amp;amp;saddr=Kova%C4%8Dka+1,+Zadar,+Hrvatska&amp;amp;daddr=&amp;amp;hl=en&amp;amp;geocode=&amp;amp;mra=ls&amp;amp;sll=45.553532,18.6397&amp;amp;sspn=0.009451,0.01929&amp;amp;ie=UTF8&amp;amp;ll=44.11292,15.226322&amp;amp;spn=0.006295,0.008768' style='color:#0000FF;text-align:left'>Od Vas do nass!</a><br /><br />";
map.openInfoWindowHtml(point, xhtml);
GEvent.addListener(marker, "click", function() {
//same code for open/close
}