function MarkerManager(d,e){var b=this;b.map_=d;b.mapZoom_=d.getZoom();b.projection_=d.getCurrentMapType().getProjection();e=e||{};b.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;var a=MarkerManager.DEFAULT_MAX_ZOOM_;if(e.maxZoom!=undefined){a=e.maxZoom}b.maxZoom_=a;b.trackMarkers_=e.trackMarkers;var c;if(typeof e.borderPadding=="number"){c=e.borderPadding}else{c=MarkerManager.DEFAULT_BORDER_PADDING_}b.swPadding_=new GSize(-c,c);b.nePadding_=new GSize(c,-c);b.borderPadding_=c;b.gridWidth_=[];b.grid_=[];b.grid_[a]=[];b.numMarkers_=[];b.numMarkers_[a]=0;b.zoomLevels_=[];b.zoomLevels_[a]=[];GEvent.bind(d,"moveend",b,b.onMapMoveEnd_);b.hide_=function(f){b.onHide(f);b.shownMarkers_--};b.show_=function(f){b.onShow(f);b.shownMarkers_++};b.add_=function(f){b.onAdd(f);b.totalMarkers_++};b.remove_=function(f){b.onRemove(f);b.totalMarkers_--};b.enter_=function(f){b.onEnter(f);b.visibleMarkers_++};b.leave_=function(f){b.onLeave(f);b.visibleMarkers_++};b.resetManager_();b.totalMarkers_=0;b.shownMarkers_=0;b.visibleMarkers_=0;b.shownGridBounds_=b.getMapGridBounds_();b.shownMapBounds_=b.map_.getBounds()}MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_MAX_ZOOM_=17;MarkerManager.DEFAULT_BORDER_PADDING_=100;MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.onHide=function(a){this.map_.removeOverlay(a)};MarkerManager.prototype.onShow=function(a){this.map_.addOverlay(a)};MarkerManager.prototype.onAdd=function(a){};MarkerManager.prototype.onRemove=function(a){};MarkerManager.prototype.onEnter=function(a){};MarkerManager.prototype.onLeave=function(a){};MarkerManager.prototype.resetManager_=function(){var c=this;var a=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE;for(var b=0;b<=c.maxZoom_;++b){c.grid_[b]=[];c.numMarkers_[b]=0;c.gridWidth_[b]=Math.ceil(a/c.tileSize_);a<<=1;c.zoomLevels_[b]=[]}};MarkerManager.prototype.clearMarkers=function(){var a=this;a.processBounds_(a.shownGridBounds_,function(c){a.hide_(c);var b=c.getPoint?c.getPoint():c.getCenter();if(b&&a.shownMapBounds_.contains(b)){a.leave_(c)}});a.processAll_(a.remove_);a.resetManager_()};MarkerManager.prototype.getTilePoint_=function(d,b,c){var a=this.projection_.fromLatLngToPixel(d,b);return new GPoint(Math.floor((a.x+c.width)/this.tileSize_),Math.floor((a.y+c.height)/this.tileSize_))};MarkerManager.prototype.addMarkerBatch_=function(d,b,f){var e=this;if(d.getPoint){var a=d.getPoint();if(this.trackMarkers_){GEvent.bind(d,"changed",this,this.onMarkerMoved_)}var c=this.getTilePoint_(a,f,GSize.ZERO);for(var j=f;j>=b;j--){var h=this.getGridCellCreate_(c.x,c.y,j);h.push(d);c.x=c.x>>1;c.y=c.y>>1}c=e.getTilePoint_(d.getPoint(),e.mapZoom_,GSize.ZERO);if(e.isGridPointVisible_(c)&&b<=e.shownGridBounds_.z&&e.shownGridBounds_.z<=f){e.show_(d);if(e.shownMapBounds_.contains(d.getPoint())){e.enter_(d)}e.notifyListeners_()}this.numMarkers_[b]++}else{for(var j=f;j>=b;j--){this.zoomLevels_[j].push(d)}if(b<=e.shownGridBounds_.z&&e.shownGridBounds_.z<=f){e.show_(d);var g=d.getPoint?d.getPoint():d.getCenter();if(g&&e.shownMapBounds_.contains(g)){e.enter_(d)}e.notifyListeners_()}this.numMarkers_[b]++}this.onAdd(d)};MarkerManager.prototype.isGridPointVisible_=function(b){var f=this;var d=f.shownGridBounds_.minY<=b.y&&b.y<=f.shownGridBounds_.maxY;var a=f.shownGridBounds_.minX;var c=a<=b.x&&b.x<=f.shownGridBounds_.maxX;if(!c&&a<0){var e=f.gridWidth_[f.shownGridBounds_.z];c=a+e<=b.x&&b.x<=e-1}return d&&c};MarkerManager.prototype.onMarkerMoved_=function(e,a,c){var g=this;var j=g.maxZoom_;var d=false;var b=g.getTilePoint_(a,j,GSize.ZERO);var f=g.getTilePoint_(c,j,GSize.ZERO);while(j>=0&&(b.x!=f.x||b.y!=f.y)){var h=g.getGridCellNoCreate_(b.x,b.y,j);if(h){if(g.removeFromArray(h,e)){g.getGridCellCreate_(f.x,f.y,j).push(e)}}if(j==g.mapZoom_){if(g.isGridPointVisible_(b)){if(!g.isGridPointVisible_(f)){g.hide_(e);d=true}}else{if(g.isGridPointVisible_(f)){g.show_(e);d=true}}}b.x=b.x>>1;b.y=b.y>>1;f.x=f.x>>1;f.y=f.y>>1;--j}if(d){g.notifyListeners_()}};MarkerManager.prototype.removeMarker=function(c){var f=this;var g=false;var e=f.maxZoom_;if(c.getPoint){var b=c.getPoint();var d=f.getTilePoint_(b,e,GSize.ZERO);while(e>=0){var a=f.getGridCellNoCreate_(d.x,d.y,e);if(a){f.removeFromArray(a,c)}if(e==f.mapZoom_){if(f.isGridPointVisible_(d)){f.hide_(c);g=true}}d.x=d.x>>1;d.y=d.y>>1;--e}}else{while(e>=0){f.removeFromArray(this.zoomLevels_[e],c);if(e==f.mapZoom_){f.hide_(c);g=true}--e}}if(g){f.notifyListeners_()}f.onRemove(c)};MarkerManager.prototype.addMarkers=function(d,e,c){var a=this.getOptMaxZoom_(c);for(var b=d.length-1;b>=0;b--){this.addMarkerBatch_(d[b],e,a)}this.numMarkers_[e]+=d.length};MarkerManager.prototype.getOptMaxZoom_=function(a){return a!=undefined?a:this.maxZoom_};MarkerManager.prototype.getMarkerCount=function(b){var a=0;for(var c=0;c<=b;c++){a+=this.numMarkers_[c]}return a};MarkerManager.prototype.inBounds=function(a){};MarkerManager.prototype.addMarker=function(b,e,c){var d=this;var a=this.getOptMaxZoom_(c);d.addMarkerBatch_(b,e,a)};MarkerManager.prototype.getGridCellCreate_=function(a,f,e){var c=this.grid_[e];if(a<0){a+=this.gridWidth_[e]}var b=c[a];if(!b){b=c[a]=[];return b[f]=[]}var d=b[f];if(!d){return b[f]=[]}return d};MarkerManager.prototype.getGridCellNoCreate_=function(a,e,d){var c=this.grid_[d];if(a<0){a+=this.gridWidth_[d]}var b=c[a];return b?b[e]:undefined};MarkerManager.prototype.getGridBounds_=function(a,j,h,f){j=Math.min(j,this.maxZoom_);var b=a.getSouthWest();var e=a.getNorthEast();var g=this.getTilePoint_(b,j,h);var d=this.getTilePoint_(e,j,f);var k=this.gridWidth_[j];if(e.lng()<b.lng()||d.x<g.x){g.x-=k}if(d.x-g.x+1>=k){g.x=0;d.x=k-1}var c=new GBounds([g,d]);c.z=j;return c};MarkerManager.prototype.getMapGridBounds_=function(){var a=this;return a.getGridBounds_(a.map_.getBounds(),a.mapZoom_,a.swPadding_,a.nePadding_)};MarkerManager.prototype.onMapMoveEnd_=function(){var a=this;this.updateMarkers_();return;a.objectSetTimeout_(this,this.updateMarkers_,0)};MarkerManager.prototype.objectSetTimeout_=function(b,c,a){return window.setTimeout(function(){c.call(b)},a)};MarkerManager.prototype.refresh=function(){var a=this;if(a.shownMarkers_>0){a.processBounds_(a.shownGridBounds_,a.hide_)}a.processBounds_(a.shownGridBounds_,a.show_);a.notifyListeners_()};MarkerManager.prototype.updateMarkers_=function(){var a=this;a.mapZoom_=this.map_.getZoom();var c=a.getMapGridBounds_();var b=this.map_.getBounds();a.checkViewport_(c,a.shownGridBounds_,b,a.shownMapBounds_,a.enter_,a.leave_);a.shownMapBounds_=b;if(c.equals(a.shownGridBounds_)&&c.z==a.shownGridBounds_.z){return}if(c.z!=a.shownGridBounds_.z){a.processBounds_(a.shownGridBounds_,a.hide_);a.processBounds_(c,a.show_)}else{a.rectangleDiff_(a.shownGridBounds_,c,a.removeCellMarkers_);a.rectangleDiff_(c,a.shownGridBounds_,a.addCellMarkers_)}a.shownGridBounds_=c;a.notifyListeners_()};MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownGridBounds_,this.shownMarkers_)};MarkerManager.prototype.processBounds_=function(c,f){for(var a=c.minX;a<=c.maxX;a++){for(var e=c.minY;e<=c.maxY;e++){this.processCellMarkers_(a,e,c.z,f)}}var d=this.zoomLevels_[c.z];for(var b=d.length-1;b>=0;b--){f(d[b])}};MarkerManager.prototype.processAll_=function(f){for(var d=this.grid_.length-1;d>=0;d--){for(var a in this.grid_[d]){for(var e in this.grid_[d][a]){for(var c=this.grid_[d][a][e].length-1;c>=0;c--){f(this.grid_[d][a][e][c])}}}}for(var b in this.zoomLevels_){for(var c=this.zoomLevels_[b].length-1;c>=0;c--){f(this.zoomLevels_[b][c])}}};MarkerManager.prototype.processCellMarkers_=function(b,f,d,e){var a=this.getGridCellNoCreate_(b,f,d);if(a){for(var c=a.length-1;c>=0;c--){e(a[c])}}};MarkerManager.prototype.removeCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.hide_)};MarkerManager.prototype.addCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.show_)};MarkerManager.prototype.rectangleDiff_=function(b,a,d){var c=this;c.rectangleDiffCoords(b,a,function(e,f){d.apply(c,[e,f,b.z])})};MarkerManager.prototype.rectangleUnion_=function(b,a,d){var c=this;c.rectangleUnionCoords(b,a,function(e,f){d.apply(c,[e,f,b.z])})};MarkerManager.prototype.checkViewport_=function(n,g,h,m,d,l){var j=this;if(h.equals(m)&&n.z==g.z){return}if(n.z!=g.z){j.processBounds_(g,function(p){var o=p.getPoint?p.getPoint():p.getCenter();if(o&&m.contains(o)){l(p)}});j.processBounds_(n,function(p){var o=p.getPoint?p.getPoint():p.getCenter();if(o&&h.contains(o)){d(p)}})}else{j.rectangleDiff_(g,n,function(o,q,p){j.processCellMarkers_(o,q,p,function(r){if(m.contains(r.getPoint())){l(r)}})});j.rectangleDiff_(n,g,function(o,q,p){j.processCellMarkers_(o,q,p,function(r){if(h.contains(r.getPoint())){d(r)}})});j.rectangleUnion_(n,g,function(o,q,p){j.processCellMarkers_(o,q,p,function(s){var r=s.getPoint();var t=h.contains(r);var u=m.contains(r);if(t&&!u){d(s)}else{if(!t&&u){l(s)}}})});var c=this.zoomLevels_[n.z];for(var f=c.length-1;f>=0;f--){var e=c[f];var k=e.getPoint?e.getPoint():e.getCenter();if(k){var a=h.contains(k);var b=m.contains(k);if(a&&!b){d(e)}else{if(!a&&b){l(e)}}}}}};MarkerManager.prototype.rectangleDiffCoords=function(b,a,m){var f=b.minX;var n=b.minY;var h=b.maxX;var d=b.maxY;var e=a.minX;var l=a.minY;var g=a.maxX;var c=a.maxY;for(var k=f;k<=h;k++){for(var j=n;j<=d&&j<l;j++){m(k,j)}for(var j=Math.max(c+1,n);j<=d;j++){m(k,j)}}for(var j=Math.max(n,l);j<=Math.min(d,c);j++){for(var k=Math.min(h+1,e)-1;k>=f;k--){m(k,j)}for(var k=Math.max(f,g+1);k<=h;k++){m(k,j)}}};MarkerManager.prototype.rectangleUnionCoords=function(d,b,l){var h=this;var g=d.z;var f=Math.max(d.minX,b.minX);var c=Math.min(d.maxX,b.maxX);var e=Math.max(d.minY,b.minY);var a=Math.min(d.maxY,b.maxY);for(var k=f;k<=c;k++){for(var j=e;j<=a;j++){l(k,j)}}};MarkerManager.prototype.removeFromArray=function(e,c,d){var a=0;for(var b=0;b<e.length;++b){if(e[b]===c||(d&&e[b]==c)){e.splice(b--,1);a++}}return a};var ANWB_MAPS_VERSION="0.1.2-SNAPSHOT";AnwbMapsMap.DEFAULT_ZOOM=7;AnwbMapsMap.DEFAULT_SINGLE_POINT_ZOOM=11;AnwbMapsMap.DEFAULT_CENTER={lat:52.08395,lng:5.26175};AnwbMapsMap.DEFAULT_MAP_TYPE="normal";AnwbMapsMap.DEFAULT_MAP_TYPES=["normal","satellite","hybrid"];AnwbMapsMap.prototype.refreshInProgress=false;AnwbMapsMap.prototype.loadingDiv=null;AnwbMapsMap.prototype.gotoDefaultViewportRequested=false;function AnwbMapsMap(a,d){Error.throwOnConditions({"container is required":(!a),"Browser does not support Google Maps.":(!AnwbMapsBrowserIsCompatible())});this.container=a;this.gmap=this.createGmapFromOptions(a,d);this.layers=new Array();if(d.layers){for(i=0;i<d.layers.length;i++){this.addLayer(AnwbMapsLayer.create(d.layers[i]))}}var c=this;var b=function(){window.setTimeout(function(){c.refreshLayers(c.getViewBoundary())},1)};GEvent.addListener(this.gmap,"moveend",b)}AnwbMapsMap.prototype.setCenter=function(a){if(a){this.gmap.setCenter(a)}};AnwbMapsMap.prototype.setZoom=function(a){this.gmap.setZoom(a)};AnwbMapsMap.prototype.createGmapFromOptions=function(c,o){var a={};if(o.height&&o.width){a.size=new GSize(o.height,o.width)}var j=function(p){if(p=="normal"){return G_NORMAL_MAP}if(p=="satellite"){return G_SATELLITE_MAP}if(p=="hybrid"){return G_HYBRID_MAP}if(p=="terrain"){return G_PHYSICAL_MAP}return undefined};if(!o.mapTypes){o.mapTypes=AnwbMapsMap.DEFAULT_MAP_TYPES}if(!o.mapType){o.mapType=AnwbMapsMap.DEFAULT_MAP_TYPE}a.mapTypes=[];var g=false;for(i=0;i<o.mapTypes.length;i++){var e=j(o.mapTypes[i]);if(e){a.mapTypes.push(e)}if(o.mapTypes[i]==o.mapType){g=true}}if(!g){o.mapTypes.push(o.mapType);a.mapTypes.push(j(o.mapType))}var b=new GMap2(c,a);var m=true;var n=true;var l=false;var f=false;var k=false;if(o){if(o.zoomable!=undefined){m=o.zoomable}if(o.draggable!=undefined){n=o.draggable}if(o.overview!=undefined){l=o.overview}if(o.scale!=undefined){f=o.scale}if(o.smallControls!=undefined){k=o.smallControls}if(o.center){if(o.center.constructor==AnwbMapsLatLng){b.setCenter(o.center.toGLatLng())}else{b.setCenter(new AnwbMapsLatLng(o.center.lat,o.center.lng).toGLatLng())}b.setZoom(o.zoom?o.zoom:AnwbMapsMap.DEFAULT_ZOOM)}else{b.setCenter(AnwbMapsLatLng.create(AnwbMapsMap.DEFAULT_CENTER).toGLatLng());b.setZoom(AnwbMapsMap.DEFAULT_ZOOM)}this.gotoDefaultViewportRequested=o.gotoDefaultViewport?o.gotoDefaultViewport:(!o.center);if(o.loadingDiv){this.loadingDiv=document.getElementById(o.loadingDiv)}if(o.mapType){var d=j(o.mapType);if(d){b.setMapType(d)}}}n?b.enableDragging():b.disableDragging();m?b.enableDoubleClickZoom():b.disableDoubleClickZoom();m?b.enableScrollWheelZoom():b.disableScrollWheelZoom();var h=this;b.oo=function(){h.gotoDefaultViewport()};if(m&&n){k?b.addControl(new GSmallMapControl()):b.addControl(new GLargeMapControl())}if(m&&!n){b.addControl(new GSmallZoomControl())}if(l){b.addControl(new GOverviewMapControl())}if(f){b.addControl(new GScaleControl())}b.addControl(new GMapTypeControl());return b};AnwbMapsMap.prototype.getViewBoundary=function(){var b=this.gmap.getBounds();var a=this.gmap.getZoom();return new AnwbMapsBoundary(new AnwbMapsLatLngBounds(new AnwbMapsLatLng(b.getSouthWest().lat(),b.getSouthWest().lng()),new AnwbMapsLatLng(b.getNorthEast().lat(),b.getNorthEast().lng())),new AnwbMapsZoomBounds(a,a))};AnwbMapsMap.prototype.setViewBoundary=function(b){var a=b.toGLatLngBounds();this.gmap.setCenter(a.getCenter(),this.gmap.getBoundsZoomLevel(a))};AnwbMapsMap.prototype.layers=new Array();AnwbMapsMap.prototype.addLayer=function(a){this.showLoadingIndicator();this.layers.push(a);a.setMap(this);a.setLoaded(false);a.refresh(this.getViewBoundary(),this.createRefreshLayersCallbackClosure())};AnwbMapsMap.prototype.loadingDiv=null;AnwbMapsMap.prototype.setLoadingDiv=function(a){this.loadingDiv=a};AnwbMapsMap.prototype.getLoadingDiv=function(){return this.loadingDiv};AnwbMapsMap.prototype.refreshLayers=function(c){if(!this.layers||this.layers.length==0){return}this.showLoadingIndicator();var b=this.createRefreshLayersCallbackClosure();for(var a in this.layers){this.layers[a].setLoaded(false)}for(var a in this.layers){this.layers[a].refresh(c,b)}};AnwbMapsMap.prototype.gotoDefaultViewport=function(){this.gotoDefaultViewportRequested=true;if(!this.refreshInProgress){this.doGotoDefaultViewport()}};AnwbMapsMap.prototype.doGotoDefaultViewport=function(){if(this.gotoDefaultViewportRequested){this.gotoDefaultViewportRequested=false;var d=null;for(var c in this.layers){var b=this.layers[c];var a=b.getCalculatedBoundary();if(a){if(d){d.extend(a.toGLatLngBounds().getSouthWest());d.extend(a.toGLatLngBounds().getNorthEast())}else{d=a.toGLatLngBounds()}}}if(d){if(d.getSouthWest().lat()==d.getNorthEast().lat()&&d.getSouthWest().lng()==d.getNorthEast().lng()){this.gmap.setCenter(d.getSouthWest(),AnwbMapsMap.DEFAULT_SINGLE_POINT_ZOOM)}else{this.setViewBoundary(AnwbMapsLatLngBounds.fromGLatLngBounds(d))}this.refreshLayers(this.getViewBoundary())}}};AnwbMapsMap.prototype.onAllLayersLoaded=function(){this.doGotoDefaultViewport()};AnwbMapsMap.prototype.createRefreshLayersCallbackClosure=function(){var b=this;var a=function(c){b.refreshLayersCallback(c)};return a};AnwbMapsMap.prototype.refreshLayersCallback=function(b){var a=true;for(var c in this.layers){if(this.layers[c]==b){continue}a=a&&this.layers[c].getLoaded()}b.setLoaded(true);if(a){this.onAllLayersLoaded();this.hideLoadingIndicator()}};AnwbMapsMap.prototype.removeLayer=function(a){for(var b in this.layers){if(this.layers[b]==a){layers.splice(b,1);a.destroy()}}};AnwbMapsMap.prototype.showLoadingIndicator=function(){this.refreshInProgress=true;if(this.loadingDiv){this.loadingDiv.style.visibility=""}};AnwbMapsMap.prototype.hideLoadingIndicator=function(){this.refreshInProgress=false;if(this.loadingDiv){this.loadingDiv.style.visibility="hidden"}};AnwbMapsBrowserIsCompatible=function(){return GBrowserIsCompatible()};Error.throwOnConditions=function(a){for(conditionName in a){if(a[conditionName]){throw new Error(conditionName)}}};function AnwbMapsBoundary(b,a){this.latLngBounds=b;this.zoomBounds=a}AnwbMapsBoundary.prototype.scale=function(g){var c=(g.x-1)*this.latLngBounds.getLatitudeWidth()/2;var b=(g.y-1)*this.latLngBounds.getLongitudeWidth()/2;if((this.latLngBounds.getLongitudeWidth()*(g.y-1))>=360){var a=new AnwbMapsLatLng(this.latLngBounds.southWest.lat-c,-180);var f=new AnwbMapsLatLng(this.latLngBounds.northEast.lat+c,180)}else{var a=new AnwbMapsLatLng(this.latLngBounds.southWest.lat-c,this.latLngBounds.southWest.lng-b);var f=new AnwbMapsLatLng(this.latLngBounds.northEast.lat+c,this.latLngBounds.northEast.lng+b)}var e=new AnwbMapsLatLngBounds(a,f);var d=new AnwbMapsZoomBounds(Math.max(this.zoomBounds.min-g.z,0),Math.min(this.zoomBounds.max+g.z,17));return new AnwbMapsBoundary(e,d)};AnwbMapsBoundary.prototype.contains=function(a){return this.latLngBounds.containsBounds(a.latLngBounds)&&this.zoomBounds.contains(a.zoomBounds)};AnwbMapsBoundary.prototype.intersects=function(a){return this.latLngBounds.intersects(a.latLngBounds)&&this.zoomBounds.intersects(a.zoomBounds)};AnwbMapsBoundary.prototype.toString=function(){return"{\n\tlatLngBounds: "+this.latLngBounds+",\n\tzoomBounds: "+this.zoomBounds+"\n}"};function AnwbMapsBoundaryMultipliers(a,c,b){this.x=a;this.y=c;this.z=b}function AnwbMapsLatLng(b,a){this.lat=AnwbMapsLatLng.normalizeLat(b);this.lng=AnwbMapsLatLng.normalizeLng(a)}AnwbMapsLatLng.normalizeLat=function(a){if(a<-90){return -90}else{if(a>90){return 90}else{return a}}};AnwbMapsLatLng.normalizeLng=function(a){return AnwbMapsLatLng.normalizeLngWithCenter(a,0)};AnwbMapsLatLng.normalizeLng360=function(a){return AnwbMapsLatLng.normalizeLngWithCenter(a,180)};AnwbMapsLatLng.normalizeLngWithCenter=function(b,a){return a+Math.ieeeRemainder(b-a,360)};AnwbMapsLatLng.prototype.toGLatLng=function(){return new GLatLng(this.lat,this.lng)};function AnwbMapsLatLngBounds(b,a){this.southWest=b;this.northEast=a}AnwbMapsLatLngBounds.prototype.getCenter=function(){var a=this.southWest.lng<this.northEast.lng?0:360;return new AnwbMapsLatLng((this.southWest.lat+this.northEast.lat)/2,((this.southWest.lng+this.northEast.lng+a)/2)-a)};AnwbMapsLatLngBounds.prototype.getLongitudeWidth=function(){return(this.northEast.lng-this.southWest.lng)+(this.southWest.lng<this.northEast.lng?0:360)};AnwbMapsLatLngBounds.prototype.getLatitudeWidth=function(){return Math.abs(this.southWest.lat-this.northEast.lat)};AnwbMapsLatLngBounds.prototype.containsLatLng=function(a){if(a.lat<this.southWest.lat||this.northEast.lat<a.lat){return false}if(this.crosses180DegreeLongtitude()){return(this.southWest.lng<=a.lng&&a.lng<=180)||(-180<=a.lng&&a.lng<=this.northEast.lng)}else{return this.southWest.lng<=a.lng&&a.lng<=this.northEast.lng}};AnwbMapsLatLngBounds.prototype.containsBounds=function(a){return this.containsLatLng(a.southWest)&&this.containsLatLng(a.northEast)};AnwbMapsLatLngBounds.prototype.intersects=function(e){var d=this.southWest.lat<e.northEast.lat;var a=this.southWest.lng<e.northEast.lng;var f=this.northEast.lat>e.southWest.lat;var b=this.northEast.lng>e.southWest.lng;var c=d&&a&&f&&b;return c};AnwbMapsLatLngBounds.prototype.crosses180DegreeLongtitude=function(){return this.southWest.lng>this.northEast.lng};AnwbMapsLatLngBounds.prototype.toGLatLngBounds=function(){return new GLatLngBounds(this.southWest.toGLatLng(),this.northEast.toGLatLng())};AnwbMapsLatLngBounds.fromGLatLngBounds=function(a){return new AnwbMapsLatLngBounds(new AnwbMapsLatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),new AnwbMapsLatLng(a.getNorthEast().lat(),a.getNorthEast().lng()))};function AnwbMapsZoomBounds(b,a){this.min=b;this.max=a}AnwbMapsZoomBounds.prototype.contains=function(a){return(this.min<=a.min||this.min==undefined)&&(this.max>=a.max||this.max==undefined)};AnwbMapsZoomBounds.prototype.intersects=function(a){return !((a.min>this.max)||(a.max<this.min))};AnwbMapsZoomBounds.prototype.containsZoomLevel=function(a){return(a==undefined)||(this.min<=a&&(this.max==undefined||this.max>=a))};AnwbMapsZoomBounds.prototype.toString=function(){return"{min: "+this.min+", max: "+this.max+"}"};Math.ieeeRemainder=function(a,e){var b=a/e;var c=Math.floor(b+0.5);if(c==b+0.5&&c%2==1){c=c-1}return a-e*c};function AnwbMapsLayer(){}AnwbMapsLayer.prototype.loaded=false;AnwbMapsLayer.prototype.calculatedBoundary=null;AnwbMapsLayer.prototype.getLoaded=function(){return this.loaded};AnwbMapsLayer.prototype.setLoaded=function(a){this.loaded=a};AnwbMapsLayer.prototype.setMap=function(a){this.map=a};AnwbMapsLayer.prototype.refresh=function(a){this.viewBoundary=a};AnwbMapsLayer.prototype.getCalculatedBoundary=function(){return this.calculatedBoundary};AnwbMapsLayer.prototype.resetCalculatedBoundary=function(){this.calculatedBoundary=null};AnwbMapsDataLayer.prototype.calculatedGLatLngBounds=null;AnwbMapsLayer.prototype.destroy=function(){};AnwbMapsDataLayer.prototype=new AnwbMapsLayer;function AnwbMapsDataLayer(a,c,d,b){this.setAction(c);this.setDataProvider(a);this.setItemProcessor(d);this.setItemManager(b)}AnwbMapsDataLayer.prototype.setMap=function(a){this.map=a;if(!this.itemManager){this.itemManager=new AnwbMapsItemManager()}this.itemManager.setMap(a);this.itemManager.setLayer(this)};AnwbMapsDataLayer.prototype.setAction=function(a){if(a){a.layer=this;this.action=a}};AnwbMapsDataLayer.prototype.setDataProvider=function(a){this.dataProvider=a};AnwbMapsDataLayer.prototype.setItemProcessor=function(a){this.itemProcessor=a};AnwbMapsDataLayer.prototype.setItemManager=function(a){this.itemManager=a?a:new AnwbMapsItemManager()};AnwbMapsDataLayer.prototype.refresh=function(c,a){AnwbMapsLayer.prototype.refresh.call(this,c);this.layerLoadedCallback=a;if(this.isRefetchNeeded()){this.dataBoundary=this.getDesiredDataBoundary();var b=this;this.dataProvider.fetchItemSet(this.dataBoundary,function(d){b.handleFetchItemSet(d)})}else{this.itemManager.refresh(false);this.layerLoadedCallback(this)}};AnwbMapsDataLayer.prototype.resetCalculatedBoundary=function(){AnwbMapsLayer.prototype.resetCalculatedBoundary.call(this);this.calculatedGLatLngBounds=null};AnwbMapsDataLayer.prototype.handleFetchItemSet=function(b){if(!this.idParam){if(!b.boundary.contains(this.getVirtualViewBoundary())){return}this.itemManager.clearItems();this.resetCalculatedBoundary()}else{if(!this.retrievedIds){this.retrievedIds={}}}if(b.boundary){this.dataBoundary=b.boundary}for(id in b.items){var c=b.items[id];if(c&&!(this.idParam&&this.retrievedIds[c[this.idParam]])){var a=this.createOverlayFromItem(c);this.itemManager.addItem(c,a,this);this.calculatedGLatLngBounds=c.extendGLatLngBounds(this.calculatedGLatLngBounds);if(this.idParam){this.retrievedIds[c[this.idParam]]=true}}}if(!this.idParam){this.itemManager.refresh(true)}if(this.layerLoadedCallback){this.layerLoadedCallback(this)}};AnwbMapsDataLayer.prototype.getCalculatedBoundary=function(){if(this.calculatedBoundary){return this.calculatedBoundary}if(!this.calculatedGLatLngBounds){return null}this.calculatedBoundary=AnwbMapsLatLngBounds.fromGLatLngBounds(this.calculatedGLatLngBounds);return this.calculatedBoundary};AnwbMapsDataLayer.prototype.createOverlayFromItem=function(d,e){if(!d){return null}var c=this.itemProcessor?this.itemProcessor.getOptions(b,d):{};var b=null;if(typeof(d)=="object"&&(d.constructor==AnwbMapsPoint||d.constructor==AnwbMapsPointAndKML)){var a=new GLatLng(d.latLng.lat,d.latLng.lng);if(!c.title){c.title=d.title}if(!c.clickable){c.clickable=!d.inert}b=new GMarker(a,c)}else{if(e&&typeof(d)=="object"&&d.constructor==AnwbMapsPolyline){if(!c.color){c.color=d.color}if(!c.weight){c.weight=d.weight}if(!c.points){c.points=d.encodedPoints}if(!c.opacity){c.opacity=d.opacity}if(!c.levels){c.levels=d.encodedLevels}if(!c.zoomFactor){c.zoomFactor=d.zoomFactor}if(!c.numLevels){c.numLevels=d.numLevels}b=new GPolyline.fromEncoded(c)}}if(b){b._item=d;d._overlay=b;d._layer=this;if(this.itemProcessor){b=this.itemProcessor.process(b,d)}}return b};AnwbMapsDataLayer.prototype.isRefetchNeeded=function(){if(!this.dataBoundary){return true}else{return !this.dataBoundary.contains(this.getVirtualViewBoundary())}};AnwbMapsDataLayer.prototype.destroy=function(){this.itemManager.clearItems()};AnwbMapsDataLayer.prototype.dataBoundaryMultipliers=new AnwbMapsBoundaryMultipliers(1.5,1.5,0);AnwbMapsDataLayer.prototype.setDataBoundaryMultipliers=function(a){this.dataBoundaryMultipliers=a};AnwbMapsDataLayer.prototype.getDesiredDataBoundary=function(){return this.viewBoundary.scale(this.dataBoundaryMultipliers)};AnwbMapsDataLayer.prototype.virtualViewBoundaryMultipliers=new AnwbMapsBoundaryMultipliers(1,1,0);AnwbMapsDataLayer.prototype.setVirtualViewBoundaryMultipliers=function(a){this.virtualViewBoundaryMultipliers=a};AnwbMapsDataLayer.prototype.getVirtualViewBoundary=function(){return this.viewBoundary.scale(this.virtualViewBoundaryMultipliers)};AnwbMapsKmlLayer.prototype=new AnwbMapsLayer;function AnwbMapsKmlLayer(a,f,d){Error.throwOnConditions({"no url provided":(!a)});this.url=a;this.zoomBounds=f;this.action=d;var b=this;var c=function(){b.kmlLoaded()};this.kmlOverlay=new GGeoXml(this.url,c);Error.throwOnConditions({"Datafile could not be loaded.":(!this.kmlOverlay)});var e=function(){b.action.execute()};GEvent.bind(this.kmlOverlay,"click",e);this.visible=false}AnwbMapsKmlLayer.prototype.kmlLoaded=function(){var a=this.kmlOverlay.getDefaultBounds();if(this.kmlOverlay.loadedCorrectly()&&a){this.calculatedBoundary=AnwbMapsLatLngBounds.fromGLatLngBounds(this.kmlOverlay.getDefaultBounds())}else{this.calculatedBoundary=null;alert("De kaart-gegevens kunnen niet geladen worden.")}this.layerLoadedCallback(this)};AnwbMapsKmlLayer.prototype.refresh=function(b,a){AnwbMapsLayer.prototype.refresh.call(this,arguments);this.layerLoadedCallback=a;newVisibility=this.zoomBounds?this.zoomBounds.contains(b.zoomBounds):true;if(this.visible!=newVisibility){if(newVisibility){this.map.gmap.addOverlay(this.kmlOverlay)}else{this.map.gmap.removeOverlay(this.kmlOverlay)}this.visible=newVisibility}if(this.kmlOverlay.loadedCorrectly()){this.kmlLoaded()}};function AnwbMapsAction(){}AnwbMapsAction.prototype.execute=function(a){};AnwbMapsInfoWindowAction.prototype=new AnwbMapsAction;function AnwbMapsInfoWindowAction(c,a,b){this.param=c;this.generator=a;this.isUrl=b}AnwbMapsInfoWindowAction.prototype.execute=function(d){var a=this.layer.map;if(this.isUrl){var b=this.generator?this.generator(d):(this.param?d[this.param]:d.url);if(b){GDownloadUrl(b,function(e){a.gmap.openInfoWindowHtml(d.getCenter(),e)})}}else{var c=this.generator?this.generator(d):(this.param?d[this.param]:d.html);if(c){a.gmap.openInfoWindowHtml(d.getCenter(),c)}}return false};AnwbMapsLinkAction.prototype=new AnwbMapsAction;function AnwbMapsLinkAction(a,b){this.urlParam=a;this.urlGenerator=b}AnwbMapsLinkAction.prototype.execute=function(b){var a;if(this.urlParam){a=b.details.get(this.urlParam)}else{a=this.urlGenerator(b.id,b.details)}if(a){location.href=a}return false};AnwbMapsDivAction.prototype=new AnwbMapsAction;function AnwbMapsDivAction(b,c,a){this.divId=b;this.sourceParam=c;this.sourceGenerator=a}AnwbMapsDivAction.prototype.execute=function(a){div=document.getElementById(this.divId);if(this.sourceGenerator){source=this.sourceGenerator(a.id,a.details)}else{source=a.details.get(this.sourceParam)}if(div){div.innerHTML=source}return true};AnwbMapsIFrameAction.prototype=new AnwbMapsAction;function AnwbMapsIFrameAction(c,a,b){this.iframeId=c;this.urlParam=a;this.urlGenerator=b}AnwbMapsIFrameAction.prototype.execute=function(item){div=document.getElementById(this.iframeId);if(this.urlGenerator){url=this.urlGenerator(item)}else{url=eval("item."+urlParam)}if(div){div.src=url}return true};function AnwbMapsDataProvider(){}AnwbMapsDataProvider.prototype.fetchItemSet=function(b,a){a(new AnwbMapsItemSet())};AnwbMapsLocalDataProvider.prototype=new AnwbMapsDataProvider;function AnwbMapsLocalDataProvider(a){this.itemSet=a}AnwbMapsLocalDataProvider.prototype.fetchItemSet=function(b,a){a(this.itemSet)};AnwbMapsJSONDataProvider.prototype=new AnwbMapsDataProvider;function AnwbMapsJSONDataProvider(a,c,b){this.url=a;this.expander=c;this.extraParams=b}AnwbMapsJSONDataProvider.prototype.fetchItemSet=function(h,g){var c=h.latLngBounds;var a=c.southWest;var f=c.northEast;var e=h.zoomBounds;var d={latsw:a.lat,lonsw:a.lng,latne:f.lat,lonne:f.lng,zoommin:e.min,zoommax:e.max};var b=this.expander;jQuery.ajax({url:this.url,data:jQuery.extend(d,this.extraParams),dataType:"json",cache:true,success:function(l){var k=[];var j=l.items;for(id in j){k.push(AnwbMapsItem.create(b(j[id])))}g(new AnwbMapsItemSet(AnwbMapsBoundary.create(l.boundary),k))},error:function(k,j){if(console){console.log("Error retrieving dataset: "+k+"("+j+")")}}})};AnwbMapsSampleDataProvider.prototype=new AnwbMapsDataProvider;function AnwbMapsSampleDataProvider(c,b,a){this.nrOfPoints=c;this.coveragePercentage=b?b:0.4;this.itemSet=null;this.newItemSetAtEveryCall=a}AnwbMapsSampleDataProvider.prototype.fetchItemSet=function(b,a){if(this.newItemSetAtEveryCall||!this.itemSet){b.zoomBounds.min=Math.max(b.zoomBounds.min-1,0);b.zoomBounds.max=Math.min(b.zoomBounds.max+1,17);this.itemSet=new AnwbMapsItemSet(b,new Array());for(i=1;i<=this.nrOfPoints;i++){this.itemSet.items.push(new AnwbMapsPoint(i,b.zoomBounds,((Math.random()*10)|0)+".) Marker #"+i,null,this.randomPoint(b.latLngBounds),true,(i%2)==0))}this.itemSet.items.push(new AnwbMapsPolyline("redl1",new AnwbMapsZoomBounds(16,18),"redline1",null,true,"#ff0000",10,1,false,"arzhHadfw@hb@c|@hJwXoB_k@lLc^~b@cm@~[iR",20,"AAAAAAA",2));this.itemSet.items.push(new AnwbMapsPolyline("greenl2",new AnwbMapsZoomBounds(13,18),"greenline2",null,true,"#00ff00",10,0.5,true,"_vxhHkmgw@hVu_@rIiR|Oy`@nMozMwX",20,"AAAAAA",2));this.itemSet.items.push(new AnwbMapsPolyline("bluel3",new AnwbMapsZoomBounds(10,18),"blueline3",null,true,"#0000ff",10,0.5,false,"u{whH_niw@jBeEvCyGz@uAKgFo@oDMkBXaBn@a@h@?r@jAHdCk@`B",20,"BBBBBBBBBBBBB",2))}a(this.itemSet)};AnwbMapsSampleDataProvider.prototype.randomPoint=function(c){var d=(Math.random()-0.5)*c.getLatitudeWidth()*this.coveragePercentage;var b=(Math.random()-0.5)*c.getLongitudeWidth()*this.coveragePercentage;var a=c.getCenter();return new AnwbMapsLatLng(a.lat+d,a.lng+b)};AnwbMapsRemoteDataProvider.prototype=new AnwbMapsDataProvider;function AnwbMapsRemoteDataProvider(a){this.delegate=a}AnwbMapsRemoteDataProvider.prototype.convertBoundaryFromJS=function(a){return a};AnwbMapsRemoteDataProvider.prototype.convertItemSetToJS=null;AnwbMapsRemoteDataProvider.prototype.fetchItemSet=function(d,c){var b=this;var a=function(e){c(b.convertItemSetToJS(e))};this.getItemSet(d,a)};AnwbMapsRemoteDataProvider.prototype.getItemSet=function(b,a){};function AnwbMapsItemSet(b,a){this.boundary=b;this.items=a}AnwbMapsItem.prototype._overlay=null;AnwbMapsItem.prototype.inert=false;function AnwbMapsItem(b,f,d,e,a,c){this.typeId=b;this.id=f;this.zoomBounds=d;this.title=e;this.getLayer=function(){return this._layer};this.getOverlay=function(){return this._overlay};this.getEventListeners=function(){return this._eventListeners};this.showInList=c}AnwbMapsItem.prototype.extendGLatLngBounds=function(a){return a};AnwbMapsItem.prototype.getCenter=function(){return null};AnwbMapsPoint.prototype=new AnwbMapsItem;AnwbMapsPoint.prototype.constructor=AnwbMapsPoint;function AnwbMapsPoint(g,e,f,a,b,d,c){this.typeId="AnwbMapsPoint";this.id=g;this.zoomBounds=e;this.title=f;this.details=a;this.latLng=b;this.showInList=d;this.inert=c}AnwbMapsPoint.prototype.extendGLatLngBounds=function(a){if(a){a.extend(new GLatLng(this.latLng.lat,this.latLng.lng))}else{a=new GLatLngBounds(new GLatLng(this.latLng.lat,this.latLng.lng),new GLatLng(this.latLng.lat,this.latLng.lng))}return a};AnwbMapsPoint.prototype.getCenter=function(){if(!this._overlay){return null}return this.getOverlay().getLatLng()};AnwbMapsPointAndKML.prototype=new AnwbMapsItem;AnwbMapsPointAndKML.prototype.constructor=AnwbMapsPointAndKML;function AnwbMapsPointAndKML(f,d,e,b,a,c){this.typeId="AnwbMapsPointAndKML";this.id=f;this.zoomBounds=d;this.title=e;this.kmlUrl=b;this.kmlZoomBounds=a;this.latLng=c}AnwbMapsPointAndKML.prototype.extendGLatLngBounds=function(a){if(a){a.extend(new GLatLng(this.latLng.lat,this.latLng.lng))}else{a=new GLatLngBounds(new GLatLng(this.latLng.lat,this.latLng.lng),new GLatLng(this.latLng.lat,this.latLng.lng))}return a};AnwbMapsPointAndKML.prototype.getCenter=function(){if(!this._overlay){return null}return this.getOverlay().getLatLng()};AnwbMapsPolyline.prototype=new AnwbMapsItem;AnwbMapsPolyline.prototype.constructor=AnwbMapsPolyline;function AnwbMapsPolyline(b,d,m,a,l,f,j,k,h,e,c,g,n){this.typeId="AnwbMapsPolyline";this.id=b;this.boundary=d;this.title=m;this.details=a;this.showInList=l;this.color=f;this.weight=j;this.opacity=k;this.inert=h;this.encodedPoints=e;this.zoomFactor=c;this.encodedLevels=g;this.numLevels=n}AnwbMapsPolyline.prototype.getCenter=function(){if(!this.getOverlay()||this.getOverlay().getVertexCount()==0){return null}var a=this.getOverlay().getVertexCount()/2;return this.getOverlay().getVertex(Math.floor(a))};AnwbMapsPolyline.prototype.extendGLatLngBounds=function(b){var a;if(this._overlay){a=this.getOverlay().getBounds()}else{a=this.boundary.latLngBounds.toGLatLngBounds()}if(b){b.extend(a.getSouthWest());b.extend(a.getNorthEast())}else{b=new GLatLngBounds(a.getSouthWest(),a.getNorthEast())}return b};AnwbMapsDwrRemoteDataProvider.prototype=new AnwbMapsRemoteDataProvider;AnwbMapsDwrRemoteDataProvider.prototype.delegate=null;function AnwbMapsDwrRemoteDataProvider(d,c,b,e){if(d.length>0&&d[d.length-1]!="/"){d=d+"/"}function a(g){this.queries=new Array();var f=this.queries;this.style=g;this.queueQuery=function(h){this.queries.push(h)};this.clear=function(){this.queries=new Array()};this.execute=function(h){if(!g||g=="fifo"){for(i=0;i<f.length;i++){f[i].apply(h)}}else{if(g=="filo"){for(i=f.length-1;i>=0;i--){f[i].apply(h)}}else{if(g=="lo"){f[f.length-1].apply(h)}else{if(g=="fo"){f[0].apply(h)}}}}this.clear()}}this.queryQueue=new a(e);if(!b){this.instantiateDelegate(d,c)}}AnwbMapsDwrRemoteDataProvider.prototype.instantiateDelegate=function(baseUrl,dataSet){this.loadingDelegate=true;var dataProvider=this;new AnwbUtilsCachingResourceLoader([baseUrl+"util.js",baseUrl+"engine.js",baseUrl+"interface/"+dataSet+".js"],function(){dataProvider.delegate=eval(dataSet);dataProvider.queryQueue.execute(dataProvider.delegate);dataProvider.loadingDelegate=false}).fetch()};AnwbMapsDwrRemoteDataProvider.prototype.submitQuery=function(a){if(this.delegate){a(this.delegate)}else{if(!this.loadingDelegate){this.instantiateDelegate()}this.queryQueue.queueQuery(a)}};AnwbMapsDwrRemoteDataProvider.prototype.getItemSet=function(d,c){var b=this;var a=function(){b.delegate.getItemSet(b.convertBoundaryFromJS(d),c)};this.submitQuery(a)};AnwbMapsDwrRemoteDataProvider.prototype.convertBoundaryFromJS=function(a){return a};AnwbMapsDwrRemoteDataProvider.prototype.convertBoundaryToJS=function(c){var b=this.convertLatLngBoundsToJS(c.latLngBounds);var a=this.convertZoomBoundsToJS(c.zoomBounds);return new AnwbMapsBoundary(b,a)};AnwbMapsDwrRemoteDataProvider.prototype.convertBoundaryMultipliersToJS=function(a){return AnwbMapsBoundaryMultipliers(a.x,a.y,a.z)};AnwbMapsDwrRemoteDataProvider.prototype.convertLatLngToJS=function(a){return new AnwbMapsLatLng(a.lat,a.lng)};AnwbMapsDwrRemoteDataProvider.prototype.convertLatLngBoundsToJS=function(c){var b=this.convertLatLngToJS(c.southWest);var a=this.convertLatLngToJS(c.northEast);return new AnwbMapsLatLngBounds(b,a)};AnwbMapsDwrRemoteDataProvider.prototype.convertItemToJS=function(a){if(a.typeId=="TypeIdMarkerData"){return this.convertPointDataToJS(a)}else{if(a.typeId=="TypeIdPolyline"){return this.convertPolylineToJS(a)}}};AnwbMapsDwrRemoteDataProvider.prototype.convertPolylineToJS=function(a){var b=this.convertZoomBoundsToJS(a.zoomBounds);return new AnwbMapsPolyline(a.id,b,a.title,a.params,a.showInList,a.color,a.weight,a.opacity,a.inert,a.encodedPoints,a.zoomFactor,a.encodedLevels,a.numLevels)};AnwbMapsDwrRemoteDataProvider.prototype.convertPointDataToJS=function(b){var a=this.convertLatLngToJS(b.point);var c=this.convertZoomBoundsToJS(b.zoomBounds);return new AnwbMapsPoint(b.id,c,b.title,b.params,a,b.showInList,b.inert)};AnwbMapsDwrRemoteDataProvider.prototype.convertItemSetToJS=function(b){var f=this.convertBoundaryToJS(b.boundary);var e=new Array(b.items.length);var d=0;for(var a=0;a<b.items.length;a++){var c=this.convertItemToJS(b.items[a]);if(!c){continue}e[d]=c;d++}return new AnwbMapsItemSet(f,e)};AnwbMapsDwrRemoteDataProvider.prototype.convertZoomBoundsToJS=function(a){return new AnwbMapsZoomBounds(a.min,a.max)};AnwbMapsSeamRemoteDataProvider.prototype=new AnwbMapsRemoteDataProvider;AnwbMapsSeamRemoteDataProvider.prototype.delegate=null;AnwbMapsSeamRemoteDataProvider.prototype=new AnwbMapsRemoteDataProvider;function AnwbMapsSeamRemoteDataProvider(d,c,b,e){if(d.length>0&&d[d.length-1]!="/"){d=d+"/"}this.baseUrl=d;this.dataSet=c;this.lazy=b;this.delegate=null;function a(g){this.queries=new Array();var f=this.queries;this.style=g;this.queueQuery=function(h){this.queries.push(h)};this.clear=function(){this.queries=new Array()};this.execute=function(h){if(!g||g=="fifo"){for(i=0;i<f.length;i++){f[i].apply(h)}}else{if(g=="filo"){for(i=f.length-1;i>=0;i--){f[i].apply(h)}}else{if(g=="lo"){f[f.length-1].apply(h)}else{if(g=="fo"){f[0].apply(h)}}}}this.clear()}}this.queryQueue=new a(e);if(!b){this.instantiateDelegate(d,c)}}AnwbMapsSeamRemoteDataProvider.prototype.instantiateDelegate=function(c,b){this.loadingDelegate=true;var a=this;this._loaderTmp=new AnwbUtilsCachingResourceLoader([c+"resource/remote.js",c+"interface.js?"+b],function(){a.delegate=Seam.Component.getInstance(b);Seam.Remoting.displayLoadingMessage=function(){};Seam.Remoting.hideLoadingMessage=function(){};a.queryQueue.execute(a.delegate);a.loadingDelegate=false}).fetch()};AnwbMapsSeamRemoteDataProvider.prototype.submitQuery=function(a){if(this.delegate){a(this.delegate)}else{if(!this.loadingDelegate){this.instantiateDelegate(this.baseUrl,this.dataSet)}this.queryQueue.queueQuery(a)}};AnwbMapsSeamRemoteDataProvider.prototype.getItemSet=function(d,c){var b=this;var a=function(){b.delegate.getItemSet(b.convertBoundaryFromJS(d),c)};this.submitQuery(a)};AnwbMapsSeamRemoteDataProvider.prototype.convertBoundaryFromJS=function(c){var b=Seam.Remoting.createType("nl.anwb.online.support.maps.LatLng");b.setLat(c.latLngBounds.southWest.lat);b.setLng(c.latLngBounds.southWest.lng);var a=Seam.Remoting.createType("nl.anwb.online.support.maps.LatLng");a.setLat(c.latLngBounds.northEast.lat);a.setLng(c.latLngBounds.northEast.lng);var e=Seam.Remoting.createType("nl.anwb.online.support.maps.LatLngBounds");e.setSouthWest(b);e.setNorthEast(a);var d=Seam.Remoting.createType("nl.anwb.online.support.maps.ZoomBounds");d.setMin(c.zoomBounds.min);d.setMax(c.zoomBounds.max);var f=Seam.Remoting.createType("nl.anwb.online.support.maps.Boundary");f.setLatLngBounds(e);f.setZoomBounds(d);return f};AnwbMapsSeamRemoteDataProvider.prototype.convertBoundaryToJS=function(c){var b=this.convertLatLngBoundsToJS(c.getLatLngBounds());var a=this.convertZoomBoundsToJS(c.getZoomBounds());return new AnwbMapsBoundary(b,a)};AnwbMapsSeamRemoteDataProvider.prototype.convertBoundaryMultipliersToJS=function(a){return new AnwbMapsBoundaryMultipliers(a.getX(),a.getY(),a.getZ())};AnwbMapsSeamRemoteDataProvider.prototype.convertLatLngToJS=function(a){return new AnwbMapsLatLng(a.getLat(),a.getLng())};AnwbMapsSeamRemoteDataProvider.prototype.convertLatLngBoundsToJS=function(c){var b=this.convertLatLngToJS(c.getSouthWest());var a=this.convertLatLngToJS(c.getNorthEast());return new AnwbMapsLatLngBounds(b,a)};AnwbMapsSeamRemoteDataProvider.prototype.convertItemToJS=function(a){if(a.typeId=="TypeIdMarkerData"){return this.convertPointDataToJS(a)}else{if(a.typeId=="TypeIdPolyline"){return this.convertPolylineToJS(a)}}};AnwbMapsSeamRemoteDataProvider.prototype.convertPointDataToJS=function(b){var a=this.convertLatLngToJS(b.getPoint());var c=this.convertZoomBoundsToJS(b.getZoomBounds());return new AnwbMapsPoint(b.getId(),c,b.getTitle(),b.getParams(),a,b.getShowInList(),b.getInert())};AnwbMapsSeamRemoteDataProvider.prototype.convertPolylineToJS=function(a){var b=this.convertZoomBoundsToJS(a.getZoomBounds());return new AnwbMapsPolyline(a.getId(),b,a.getTitle(),a.getParams(),a.getShowInList(),a.getColor(),a.getWeight(),a.getOpacity(),a.getInert(),a.getEncodedPoints(),a.getZoomFactor(),a.getEncodedLevels(),a.getNumLevels())};AnwbMapsSeamRemoteDataProvider.prototype.convertItemSetToJS=function(b){var f=this.convertBoundaryToJS(b.getBoundary());var e=new Array(b.getItems().length);var d=0;for(var a=0;a<b.items.length;a++){var c=this.convertItemToJS(b.items[a]);if(!c){continue}e[d]=c;d++}return new AnwbMapsItemSet(f,e)};AnwbMapsSeamRemoteDataProvider.prototype.convertZoomBoundsToJS=function(a){return new AnwbMapsZoomBounds(a.getMin(),a.getMax())};function AnwbMapsItemManager(a){if(a){this.setMap(a)}}AnwbMapsItemManager.prototype.setMap=function(a){this.map=a;if(this.markerManager){this.clearItems()}this.markerManager=this.createMarkerManager(a.gmap)};AnwbMapsItemManager.prototype.setLayer=function(a){this.layer=a};AnwbMapsItemManager.prototype.createMarkerManager=function(c){var b=this;var a=new MarkerManager(c);a.onHide=function(d){};a.onShow=function(d){};a.onLeave=function(d){c.removeOverlay(d);d._anwb_is_on_map=false;b.onLeave(d._item)};a.onEnter=function(d){c.addOverlay(d);d._anwb_is_on_map=true;b.onEnter(d._item)};return a};AnwbMapsItemManager.prototype.onLeave=function(){};AnwbMapsItemManager.prototype.onEnter=function(){};AnwbMapsItemManager.prototype.onClickCallback=function(a){if(a&&!a.inert&&a._layer&&a._layer.action){return a._layer.action.execute(a)}else{return true}};AnwbMapsItemManager.prototype.registerEventListeners=function(d,b){if(d.inert){return new Array()}var c=this;var a=GEvent.addListener(b,"click",function(e){c.onClickCallback(d)});return new Array(a)};AnwbMapsItemManager.prototype.items=new Array();AnwbMapsItemManager.prototype.addItem=function(d,b,c){if(b){d._eventListeners=this.registerEventListeners(d,b)}this.items.push(d);if(typeof(d)=="object"&&d.constructor==AnwbMapsPoint){var e=d.zoomBounds?d.zoomBounds.min:0;var a=d.zoomBounds?d.zoomBounds.max:17;this.markerManager.addMarker(b,e,a)}};AnwbMapsItemManager.prototype.clearItems=function(){for(itemId in this.items){var a=this.items[itemId];if(a._eventListeners){for(eventId in a._eventListeners){GEvent.removeListener(a._eventListeners[eventId])}}if(typeof(a)=="object"&&a.constructor==AnwbMapsPolyline){if(a._overlay){this.map.gmap.removeOverlay(a._overlay)}}}this.markerManager.clearMarkers();delete this.items;this.items=new Array()};AnwbMapsItemManager.prototype.refresh=function(c){if(c){this.markerManager.refresh()}var d=this.map.getViewBoundary();for(var a=0,b;b=this.items[a++];){if(typeof(b)=="object"&&b.constructor==AnwbMapsPolyline){if(b.boundary.intersects(d)){if(!b._overlay){this.layer.createOverlayFromItem(b,true);b._eventListeners=this.registerEventListeners(b,b._overlay)}if(!b._shownOnMap){this.map.gmap.addOverlay(b._overlay);b._shownOnMap=true;this.onEnter(b)}}else{if(b._shownOnMap){this.map.gmap.removeOverlay(b._overlay);b._shownOnMap=false;this.onLeave(b)}}}}};AnwbMapsItemManager.prototype.isVisible=function(a){if(typeof(a)=="object"&&(a.constructor==AnwbMapsPoint||a.constructor==AnwbMapsPointAndKML)){if(a._overlay._anwb_is_on_map!=undefined&&!a._overlay._anwb_is_on_map){return false}if(a._overlay.isHidden()){return false}return this.map.gmap.getBounds().contains(a._overlay.getPoint())&&(!a.zoomBounds||a.zoomBounds.containsZoomLevel(this.map.gmap.getZoom()))}else{if(typeof(a)=="object"&&a.constructor==AnwbMapsPolyline){return !a._overlay.isHidden()}}};AnwbMapsListBoundItemManager.prototype=new AnwbMapsItemManager;function AnwbMapsListBoundItemManager(d,c,a,b){this.style=c;this.list=d;if(a){this.includeItemInList=a}if(b){this.createListItem=b}}AnwbMapsListBoundItemManager.prototype.listItems=new Array();AnwbMapsListBoundItemManager.prototype.style=null;AnwbMapsListBoundItemManager.prototype.list=new Array();AnwbMapsListBoundItemManager.SHOW_ALL_SELECTOR=function(){return true};AnwbMapsListBoundItemManager.SHOW_IN_LIST_SELECTOR=function(a){return !a.inert&&a.showInList};AnwbMapsListBoundItemManager.prototype.includeItemInList=AnwbMapsListBoundItemManager.SHOW_IN_LIST_SELECTOR;AnwbMapsListBoundItemManager.HREF_LIST_ITEM_CREATOR=function(d,b,c,a){listHref=document.createElement("a");listHref.innerHTML=d.title;listHref.onclick=b;listHref.onmouseover=c;listHref.onmouseout=a;listItem=document.createElement("li");listItem.appendChild(listHref);this.showListItem(listItem,false);return listItem};AnwbMapsListBoundItemManager.prototype.createListItem=AnwbMapsListBoundItemManager.HREF_LIST_ITEM_CREATOR;AnwbMapsListBoundItemManager.prototype.addItem=function(c,a,b){AnwbMapsItemManager.prototype.addItem.call(this,c,a,b)};AnwbMapsListBoundItemManager.prototype.clearItems=function(){this.clearListItems();AnwbMapsItemManager.prototype.clearItems.call(this)};AnwbMapsListBoundItemManager.prototype.clearListItems=function(){while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.listItems=new Array()};AnwbMapsListBoundItemManager.prototype.itemSortCompare=function(d,c){if(d.title<c.title){return -1}if(d.title>c.title){return 1}return 0};AnwbMapsListBoundItemManager.prototype.refresh=function(d){AnwbMapsItemManager.prototype.refresh.call(this,d);if(d){this.clearListItems();this.items.sort(this.itemSortCompare);for(itemId in this.items){var c=this.addListItem(this.items[itemId]);if(c){this.list.appendChild(c)}}}for(itemId in this.items){var b=this.items[itemId];if(b&&b._overlay){var a=this.isVisible(b);this.showListItem(this.listItems[b.id],a)}}};AnwbMapsListBoundItemManager.prototype.showListItem=function(b,a){if(!b){return}if(a){b.style.visibility="";b.style.height=""}else{b.style.visibility="hidden";b.style.height="0px"}};AnwbMapsListBoundItemManager.prototype.addListItem=function(e){if(this.includeItemInList(e)){itemManager=this;var b=function(){var f=itemManager.onClickCallback(e);if(f){itemManager.map.setCenter(e.getCenter())}};var c=function(){itemManager.onMouseOverCallback(e)};var a=function(){itemManager.onMouseOutCallback(e)};var d=this.createListItem(e,b,c,a);this.listItems[e.id]=d;this.updateListItemStyle(e,false,true);return d}else{return null}};AnwbMapsListBoundItemManager.prototype.registerEventListeners=function(d,a){var c=this;var b=AnwbMapsItemManager.prototype.registerEventListeners.call(this,d,a);if(this.includeItemInList(d)){b.push(GEvent.addListener(a,"mouseover",function(){c.onMouseOverCallback(d)}));b.push(GEvent.addListener(a,"mouseout",function(){c.onMouseOutCallback(d)}))}return b};AnwbMapsListBoundItemManager.prototype.onClickCallback=function(a){if(this.style.visited){this.registerVisit(a)}return AnwbMapsItemManager.prototype.onClickCallback.call(this,a)};AnwbMapsListBoundItemManager.prototype.visitedItems=new Array();AnwbMapsListBoundItemManager.prototype.registerVisit=function(a){this.visitedItems[a.id]=true};AnwbMapsListBoundItemManager.prototype.onMouseOverCallback=function(a){this.updateListItemStyle(a,true)};AnwbMapsListBoundItemManager.prototype.onMouseOutCallback=function(a){this.updateListItemStyle(a,false)};AnwbMapsListBoundItemManager.prototype.updateListItemStyle=function(e,c,d){var a=this.style.marker&&!d&&e._overlay.Nm;var b=this.style.visited&&this.visitedItems[e.id];if(c){this.listItems[e.id].firstChild.className=(b)?this.style.visited.hover:this.style.normal.hover;if(a){e._overlay.setImage(this.style.marker.hover)}}else{this.listItems[e.id].firstChild.className=(b)?this.style.visited.inactive:this.style.normal.inactive;if(a){e._overlay.setImage(this.style.marker.inactive)}}};AnwbMapsCategoryItemManager.prototype=new AnwbMapsItemManager;function AnwbMapsCategoryItemManager(f,b,d,e,a,c){this.parameter=f;this.onUpdateCount=b;this.onEnterView=d;this.onLeaveView=e;this.onHideCategory=a;this.onShowCategory=c;this.categoryItems={};this.categoryCounts={}}AnwbMapsCategoryItemManager.prototype.setActiveCategory=function(a){if(this.activeCategory==a){return}for(i in this.categoryItems[this.activeCategory]){this.onLeaveView(this.categoryItems[this.activeCategory][i],this.activeCategory)}for(i in this.categoryItems[a]){this.onEnterView(this.categoryItems[a][i],a,this)}this.activeCategory=a};AnwbMapsCategoryItemManager.prototype.onLeave=function(c){var b=c[this.parameter];var d=this.categoryItems[b];var a=0;while(a<d.length){d[a]==c?d.splice(a,1):a++}this.categoryCounts[b]--;if(b==this.activeCategory){this.onLeaveView(c,b,this)}this.onUpdateCount(b,this.categoryCounts[b]);if(this.categoryCounts[b]==0){this.onHideCategory(b)}};AnwbMapsCategoryItemManager.prototype.onEnter=function(b){var a=b[this.parameter];if(!this.categoryItems[a]){this.categoryItems[a]=[]}this.categoryItems[a].push(b);if(!this.categoryCounts[a]){this.categoryCounts[a]=0}this.categoryCounts[a]++;if(a==this.activeCategory){this.onEnterView(b,a,this)}this.onUpdateCount(a,this.categoryCounts[a]);if(this.categoryCounts[a]==1){this.onShowCategory(a)}};function AnwbMapsItemProcessor(a){this.nextProcessor=a}AnwbMapsItemProcessor.prototype.attachProcessor=function(a){if(this.nextProcessor){a.attachProcessor(this.nextProcessor)}this.nextProcessor=a;return this};AnwbMapsItemProcessor.prototype.preProcess=function(b,a){return b};AnwbMapsItemProcessor.prototype.postProcess=function(b,a){return b};AnwbMapsItemProcessor.prototype.getOptions=function(b,a){return{}};AnwbMapsItemProcessor.prototype.process=function(b,a){b=this.preProcess(b,a);if(this.nextProcessor){b=this.nextProcessor.process(b,a)}return this.postProcess(b,a)};AnwbMapsDefaultIconItemProcessor.prototype=new AnwbMapsItemProcessor;function AnwbMapsDefaultIconItemProcessor(a,b){this.nextProcessor=a;this.defaultIcon=b}AnwbMapsDefaultIconItemProcessor.prototype.getOptions=function(a,b){return{icon:this.defaultIcon}};AnwbMapsIconConfigurerItemProcessor.prototype=new AnwbMapsItemProcessor;function AnwbMapsIconConfigurerItemProcessor(b,a,c,d){this.nextProcessor=b;this.groupParamName=a;if(c){this.markerGroups=c}else{this.markerGroups={}}this.defaultIcon=d}AnwbMapsIconConfigurerItemProcessor.prototype.addMarkerGroup=function(b,a){this.markerGroups[b]=a};AnwbMapsIconConfigurerItemProcessor.prototype.removeMarkerGroup=function(a){delete this.markerGroups[a]};AnwbMapsIconConfigurerItemProcessor.prototype.setGroupParamName=function(a){this.groupParamName=a};AnwbMapsIconConfigurerItemProcessor.prototype.getGroupParamName=function(){return groupParamName};AnwbMapsIconConfigurerItemProcessor.prototype.setDefaultIcon=function(a){this.defaultIcon=a};AnwbMapsIconConfigurerItemProcessor.prototype.getDefaultIcon=function(){return this.defaultIcon};AnwbMapsIconConfigurerItemProcessor.prototype.getOptions=function(a,b){return{icon:this.markerGroups[b[this.groupParamName]]||this.defaultIcon}};var nl={anwb:{online:{support:{maps:{Map:AnwbMapsMap,BrowserIsCompatible:AnwbMapsBrowserIsCompatible,Boundary:AnwbMapsBoundary,BoundaryMultipliers:AnwbMapsBoundaryMultipliers,LatLng:AnwbMapsLatLng,LatLngBounds:AnwbMapsLatLngBounds,ZoomBounds:AnwbMapsZoomBounds,layer:{Layer:AnwbMapsLayer,DataLayer:AnwbMapsDataLayer,KmlLayer:AnwbMapsKmlLayer},manager:{ItemManager:AnwbMapsItemManager,ListBoundItemManager:AnwbMapsListBoundItemManager},processor:{ItemProcessor:AnwbMapsItemProcessor,IconConfigurerItemProcessor:AnwbMapsIconConfigurerItemProcessor,DefaultIconItemProcessor:AnwbMapsDefaultIconItemProcessor},dataprovider:{DataProvider:AnwbMapsDataProvider,LocalDataProvider:AnwbMapsLocalDataProvider,SampleDataProvider:AnwbMapsSampleDataProvider,RemoteDataProvider:AnwbMapsRemoteDataProvider,DwrRemoteDataProvider:AnwbMapsDwrRemoteDataProvider,SeamRemoteDataProvider:AnwbMapsSeamRemoteDataProvider},Item:AnwbMapsItem,Point:AnwbMapsPoint,Polyline:AnwbMapsPolyline,ItemSet:AnwbMapsItemSet,action:{Action:AnwbMapsAction,InfoWindowAction:AnwbMapsInfoWindowAction,LinkAction:AnwbMapsLinkAction,DivAction:AnwbMapsDivAction,IFrameAction:AnwbMapsIFrameAction}}}}}};function AnwbUtilsResourceLoader(b,a){this.resources=b;this.onLoadCallback=a}AnwbUtilsResourceLoader.prototype.fetch=function(){if(this.resources.length<1){if(this.onLoadCallback){f()}return}var d=document.getElementsByTagName("head")[0];var a=this;var g=this.resources;var f=this.onLoadCallback;var b=g.length;var c=function(k,l){var j=false;return function(){if(!j){j=true;if(a.postFetchCallback){a.postFetchCallback(k)}if(--b==0){a.onLoadCallback();d.removeChild(l)}}}};for(i=0;i<g.length;i++){var e=g[i];if(typeof(e)=="string"){e={url:e}}if(!e.type){e.type="text/javascript"}if(!a.preFetchCallback||a.preFetchCallback(e)){var h=document.createElement("script");h.src=e.url;h.type=e.type;if(f){h.callback=c(e,h);if(e.callbackSetter){e.callbackSetter(h.callback)}else{h.onload=h.onreadystatechange=function(){if(!this.readyState||this.readyState=="complete"||this.readyState=="loaded"){this.callback()}}}}d.appendChild(h)}else{if(--b==0){this.onLoadCallback()}}}};AnwbUtilsCachingResourceLoader.prototype=new AnwbUtilsResourceLoader;function AnwbUtilsCachingResourceLoader(c,b,a,d){AnwbUtilsResourceLoader.call(this,c,b);this.reschedule=a;loaderClass=AnwbUtilsCachingResourceLoader;this.cacheRegister=d||loaderClass.resourceCache?loaderClass.resourceCache:loaderClass.resourceCache={}}AnwbUtilsCachingResourceLoader.prototype.postFetchCallback=function(a){this.cacheRegister[a.src]=true};AnwbUtilsCachingResourceLoader.prototype.preFetchCallback=function(a){var c=this.cacheRegister[a.url];var b=(c==undefined)?true:(this.reschedule&&c==false);if(b){this.cacheRegister[a.url]=false}return b};AnwbUtilsResourceLoader.loadAnwbMaps=function(a){if(typeof(a)=="function"){createCallback=a}else{createCallback=function(){AnwbMaps.create(a)}}var b=[{url:"http://maps.google.com/maps?file=api&v=2&key="+ANWB_MAPS_KEY+"&async=2&callback=_anwbMapsOnLoadCallback",callbackSetter:function(c){self._anwbMapsOnLoadCallback=c}},"markermanager.js","nl.anwb.maps.js","nl.anwb.maps.model.js","nl.anwb.maps.action.js","nl.anwb.maps.processor.js","nl.anwb.maps.manager.js","nl.anwb.maps.layer.js","nl.anwb.maps.dataprovider.js","nl.anwb.maps.dataprovider.dwr.js","nl.anwb.maps.dataprovider.seam.js","nl.anwb.maps.factory.js","nl.anwb.maps.classes.js"];new AnwbUtilsCachingResourceLoader(b,createCallback).fetch()};Function.AbstractFunction=function(){throw new Error("Abstract function called.")};Error.throwOnConditions=function(a){for(conditionName in a){if(a[conditionName]){throw new Error(conditionName)}}};AnwbMapsAction.create=function(a){if(!a||a.constructor!=Object){return a}if(a.type=="info-window"){return new AnwbMapsInfoWindowAction.create(a)}else{if(a.type=="link"){return new AnwbMapsLinkAction.create(a)}else{if(a.type=="div"){return new AnwbMapsDivAction.create(a)}else{if(a.type=="iframe"){return new AnwbMapsIFrameAction.create(a)}else{return null}}}}};AnwbMapsInfoWindowAction.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsInfoWindowAction(a.param,a.generator,a.isUrl)};AnwbMapsDivAction.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsDivAction(a.div,a.param,a.generator)};AnwbMapsLinkAction.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsLinkAction(a.param,a.generator)};AnwbMapsIFrameAction.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsIFrameAction(a.iframe,a.preFix,a.param,a.postFix,a.generator)};AnwbMapsDataProvider.create=function(a){if(!a||a.constructor!=Object){return a}if(a.type=="seam"){return new AnwbMapsSeamRemoteDataProvider.create(a)}else{if(a.type=="dwr"){return new AnwbMapsDwrRemoteDataProvider.create(a)}else{if(a.type=="local"){return new AnwbMapsLocalDataProvider.create(a)}else{return null}}}};AnwbMapsLocalDataProvider.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsLocalDataProvider(AnwbMapsItemSet.create(a.itemSet))};AnwbMapsSeamRemoteDataProvider.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsSeamRemoteDataProvider(a.baseUrl,a.dataSet,a.lazy,a.queueStyle)};AnwbMapsDwrRemoteDataProvider.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsDwrRemoteDataProvider(a.baseUrl,a.dataSet,a.lazy,a.queueStyle)};AnwbMapsJSONDataProvider.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsJSONDataProvider(a.url,a.expander,a.extraParams)};AnwbMapsLayer.create=function(b){if(!b||b.constructor!=Object){return b}var a;if(b.type=="kml"){a=new AnwbMapsKmlLayer.create(b)}else{if(b.type=="data"){a=new AnwbMapsDataLayer.create(b)}}return a};AnwbMapsDataLayer.create=function(b){if(!b||b.constructor!=Object){return b}var a=new AnwbMapsDataLayer(AnwbMapsDataProvider.create(b.dataProvider),AnwbMapsAction.create(b.action),AnwbMapsItemProcessor.create(b.itemProcessor),AnwbMapsItemManager.create(b.itemManager),AnwbMapsBoundary.create(b.activeBoundary));if(b.dataBoundaryMultipliers){a.setDataBoundaryMultipliers(AnwbMapsBoundaryMultipliers.create(b.dataBoundaryMultipliers))}if(b.viewBoundaryMultipliers){a.setVirtualViewBoundaryMultipliers(AnwbMapsBoundaryMultipliers.create(b.virtualViewBoundaryMultipliers))}return a};AnwbMapsKmlLayer.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsKmlLayer(a.url,AnwbMapsZoomBounds.create(a.zoomBounds),AnwbMapsAction.create(a.action),AnwbMapsBoundary.create(a.activeBoundary))};AnwbMapsMap.create=function(a,b){if(!a||a.constructor!=Object){return a}map=new AnwbMapsMap(b,a);for(i=0;i<a.layers.length;i++){map.addLayer(AnwbMapsLayer.create(a.layers[i]))}return map};AnwbMapsItemManager.create=function(a){if(!a||a.constructor!=Object){return a}if(a.type=="list"){return AnwbMapsListBoundItemManager.create(a)}else{if(a.type=="category"){return AnwbMapsCategoryItemManager.create(a)}else{return new AnwbMapsItemManager()}}};AnwbMapsListBoundItemManager.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsListBoundItemManager(a.list,a.style,a.selector,a.creator)};AnwbMapsCategoryItemManager.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsCategoryItemManager(a.parameter,a.onUpdateCount,a.onEnterView,a.onLeaveView,a.onHideCategory,a.onShowCategory)};AnwbMapsBoundary.create=function(a){if(a=="EVERYTHING"){a={latLngBounds:{southWest:{lat:-90,lng:-180},northEast:{lat:90,lng:180}},zoomBounds:{min:0,max:18}}}if(!a||a.constructor!=Object){return a}if(a.bounds&&!a.latLngBounds){a.latLngBounds=a.bounds}return new AnwbMapsBoundary(AnwbMapsLatLngBounds.create(a.latLngBounds),AnwbMapsZoomBounds.create(a.zoomBounds))};AnwbMapsLatLngBounds.create=function(a){if(a&&a.constructor==GBounds){return AnwbMapsLatLngBounds.createFromGoogle(a)}if(!a||a.constructor!=Object){return a}return new AnwbMapsLatLngBounds(AnwbMapsLatLng.create(a.southWest),AnwbMapsLatLng.create(a.northEast))};AnwbMapsLatLngBounds.createFromGoogle=function(a){return new AnwbMapsLatLngBounds(AnwbMapsLatLng.create(a.getSouthWest()),AnwbMapsLatLng.create(a.getNorthEast()))};AnwbMapsLatLng.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsLatLng(a.lat,a.lng)};AnwbMapsZoomBounds.create=function(a){if(!a||a.constructor==AnwbMapsZoomBounds){return a}if(typeof(a)=="number"){return new AnwbMapsZoomBounds(a,a)}return new AnwbMapsZoomBounds(a.min,a.max)};AnwbMapsBoundaryMultipliers.create=function(a){if(!a||a.constructor==AnwbMapsBoundaryMultipliers){return a}return new AnwbMapsBoundaryMultipliers(a.x,a.y,a.z)};AnwbMapsItemSet.create=function(b){if(!b||b.constructor!=Object){return b}var a=[];for(i=0;i<b.items.length;i++){a.push(AnwbMapsItem.create(b.items[i]))}return new AnwbMapsItemSet(AnwbMapsBoundary.create(b.boundary||"EVERYTHING"),a)};AnwbMapsItem.create=function(a){if(!a||a.constructor!=Object){return a}if(!a.type||a.type=="point"){delete a.type;return AnwbMapsPoint.create(a)}else{if(a.type=="point-kml"){delete a.type;return AnwbMapsPointAndKML.create(a)}else{if(a.type=="line"){delete a.type;return AnwbMapsPolyline.create(a)}}}};AnwbMapsPoint.create=function(b){if(!b||b.constructor!=Object){return b}var a=new AnwbMapsPoint(b.id,AnwbMapsZoomBounds.create(b.zoomBounds),b.title,null,AnwbMapsLatLng.create(b.latLng||b.point),b.showInList,b.inert);for(key in b){if(key!="id"&&key!="zoomBounds"&&key!="title"&&key!="details"&&key!="latLng"&&key!="point"&&key!="showInList"&&key!="inert"){a[key]=b[key]}}return a};AnwbMapsPointAndKML.create=function(b){if(!b||b.constructor!=Object){return b}var a=new AnwbMapsPointAndKML(b.id,AnwbMapsZoomBounds.create(b.zoomBounds),b.title,b.kmlUrl,AnwbMapsZoomBounds.create(b.kmlZoomBounds),AnwbMapsLatLng.create(b.latLng||b.point));for(key in b){if(key!="id"&&key!="zoomBounds"&&key!="title"&&key!="kmlUrl"&&key!="kmlZoomBounds"&&key!="latLng"&&key!="point"){a[key]=b[key]}}return a};AnwbMapsPolyline.create=function(b){if(!b||b.constructor!=Object){return b}var a=new AnwbMapsPolyline(b.id,AnwbMapsBoundary.create(b.boundary),b.title,b.details,b.showInList,b.color,b.weight,b.opacity,b.inert,b.encodedPoints,b.zoomFactor,b.encodedLevels,b.numLevels);for(key in b){if(key!="id"&&key!="boundary"&&key!="title"&&key!="details"&&key!="showInList"&&key!="color"&&key!="weight"&&key!="opacity"&&key!="inert"&&key!="encodedPoints"&&key!="zoomFactor"&&key!="encodedLevels"&&key!="numLevels"){a[key]=b[key]}}return a};AnwbMapsItemProcessor.create=function(a){if(!a||a.constructor!=Object){return a}if(a.type=="default-icon"){return new AnwbMapsDefaultIconItemProcessor.create(a)}else{if(a.type=="group-icon"){return new AnwbMapsIconConfigurerItemProcessor.create(a)}}};AnwbMapsDefaultIconItemProcessor.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsDefaultIconItemProcessor(a.nextProcessor,a.icon)};AnwbMapsIconConfigurerItemProcessor.create=function(a){if(!a||a.constructor!=Object){return a}return new AnwbMapsIconConfigurerItemProcessor(a.nextProcessor,a.parameter,a.groups,a.defaultIcon)};
