-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);
- }
-}
-
-function removeMarkerFromMap(marker){
- markers.removeMarker(marker);
-}
-
-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 unproj(map.getLonLatFromViewPortPx(event.xy));
+function getMapBaseLayer() {
+ for (var i = 0; i < layers.length; i++) {
+ if (map.hasLayer(layers[i].layer)) {
+ return layers[i];
+ }
+ }