-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);
+function getMapBaseLayer() {
+ for (var i = 0; i < layers.length; i++) {
+ if (map.hasLayer(layers[i].layer)) {
+ return layers[i];
+ }
+ }