-function openMapPopup(marker, description) {
- closeMapPopup();
-
- popup = new OpenLayers.Popup.FramedCloud("popup", marker.lonlat, null,
- description, marker.icon, true);
- popup.setBackgroundColor("#E3FFC5");
- map.addPopup(popup);
-
- return popup;
-}
-
-function closeMapPopup() {
- if (popup) {
- map.removePopup(popup);
- delete popup;
- }
-}
-
-function removeMarkerFromMap(marker){
- markers.removeMarker(marker);
-}
-
-function removeBoxFromMap(box){
- vectors.removeFeature(box);
-}
-
-function proj(x) {
- return x.clone().transform(epsg4326, map.getProjectionObject());
-}
-
-function unproj(x) {
- return x.clone().transform(map.getProjectionObject(), epsg4326);
-}
-
-function setMapCenter(center, zoom) {
- zoom = parseInt(zoom, 10);
- var numzoom = map.getNumZoomLevels();
- if (zoom >= numzoom) zoom = numzoom - 1;
- map.setCenter(proj(center), zoom);
-}
-
-function getEventPosition(event) {
- return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326);