sg

Perşembe, Ocak 05, 2006

Re: map2.31.js


Wasn't it Pil who wrote:
>
>
>Does someone already have a functioning map using map2.31.js, so that
>one can look at the code?

Here's a snippet of code that works with map2.31.js. Note that GPoint is
replaced by GLatLng (which has the parameters in the opposite order) and
map.centerAndZoom() is replaced by map.setCenter() and map.setZoom()

function createMarker(point,html) {
html = '<div style="white-space:nowrap;">' + html + '</div>';
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
return marker;
}

var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(43.907787,-79.359741));
map.setZoom(8);

var point = new GLatLng(43.65654,-79.90138);
var marker = createMarker(point,'Hello World');
map.addOverlay(marker);

--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık