
var map,geocoder,marker;

function findAddress(adres) {
      if(!geocoder)
        geocoder = new GClientGeocoder();
      geocoder.getLatLng(
        adres,
        function(point) {
          if(!point) {
            alert('Nie znaleziono wskazanego adresu !!!');
          } else {
            marker.setLatLng(point);
            map.setCenter(point,15);
          }
      });
}


function load(miasto, dzielnica, ulica) {
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));

        geocoder = new GClientGeocoder();
        map.addControl(new GLargeMapControl());

        marker = new GMarker(new GLatLng(50.2644538,19.0228711),{draggable:true});
        map.addOverlay(marker);

        findAddress("Poland, "+miasto+", "+dzielnica+", "+ulica);
    }
}
