PageSourceSearch

https://eidsvoll1814.no/assets/gen/m24_maps.js?dfddf3f6

js eidsvoll1814.no collected 2026-09-25 00:28:23 UTC 51,096 bytes, 111 lines download raw bytes

1function ClusterIcon(cluster,styles){cluster.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.cluster_=cluster,this.className_=cluster.getMarkerClusterer().getClusterClass(),this.styles_=styles,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(cluster.getMap())}function Cluster(mc){this.markerClusterer_=mc,this.map_=mc.getMap(),this.gridSize_=mc.getGridSize(),this.minClusterSize_=mc.getMinimumClusterSize(),this.averageCenter_=mc.getAverageCenter(),this.hideLabel_=mc.getHideLabel(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,mc.getStyles())}function MarkerClusterer(map,opt_markers,opt_options){this.extend(MarkerClusterer,google.maps.OverlayView),opt_markers=opt_markers||[],opt_options=opt_options||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=opt_options.gridSize||60,this.minClusterSize_=opt_options.minimumClusterSize||2,this.maxZoom_=opt_options.maxZoom||null,this.styles_=opt_options.styles||[],this.title_=opt_options.title||"",this.zoomOnClick_=!0,void 0!==opt_options.zoomOnClick&&(this.zoomOnClick_=opt_options.zoomOnClick),this.averageCenter_=!1,void 0!==opt_options.averageCenter&&(this.averageCenter_=opt_options.averageCenter),this.ignoreHidden_=!1,void 0!==opt_options.ignoreHidden&&(this.ignoreHidden_=opt_options.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==opt_options.enableRetinaIcons&&(this.enableRetinaIcons_=opt_options.enableRetinaIcons),this.hideLabel_=!1,void 0!==opt_options.hideLabel&&(this.hideLabel_=opt_options.hideLabel),this.imagePath_=opt_options.imagePath||MarkerClusterer.IMAGE_PATH,this.imageExtension_=opt_options.imageExtension||MarkerClusterer.IMAGE_EXTENSION,this.imageSizes_=opt_options.imageSizes||MarkerClusterer.IMAGE_SIZES,this.calculator_=opt_options.calculator||MarkerClusterer.CALCULATOR,this.batchSize_=opt_options.batchSize||MarkerClusterer.BATCH_SIZE,this.batchSizeIE_=opt_options.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE,this.clusterClass_=opt_options.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(opt_markers,!0),this.setMap(map)}ClusterIcon.prototype.onAdd=function(){var cMouseDownInCluster,cDraggingMapByCluster,cClusterIcon=this;this.div_=document.createElement("div"),this.div_.className=this.className_,this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",function(){cDraggingMapByCluster=cMouseDownInCluster}),google.maps.event.addDomListener(this.div_,"mousedown",function(){cMouseDownInCluster=!0,cDraggingMapByCluster=!1}),google.maps.event.addDomListener(this.div_,"click",function(e){if(cMouseDownInCluster=!1,!cDraggingMapByCluster){var theBounds,mz,mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"click",cClusterIcon.cluster_),google.maps.event.trigger(mc,"clusterclick",cClusterIcon.cluster_),mc.getZoomOnClick()&&(mz=mc.getMaxZoom(),theBounds=cClusterIcon.cluster_.getBounds(),mc.getMap().fitBounds(theBounds),setTimeout(function(){mc.getMap().fitBounds(theBounds),null!==mz&&mc.getMap().getZoom()>mz&&mc.getMap().setZoom(mz+1)},100)),e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"mouseover",cClusterIcon.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"mouseout",cClusterIcon.cluster_)})},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.draw=function(){if(this.visible_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.top=pos.y+"px",this.div_.style.left=pos.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var img="",bp=this.backgroundPosition_.split(" "),spriteH=parseInt(bp[0].trim(),10),spriteV=parseInt(bp[1].trim(),10),pos=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(pos),img="<img src='"+this.url_+"' style='position: absolute; top: "+spriteV+"px; left: "+spriteH+"px; ",img+=this.cluster_.getMarkerClusterer().enableRetinaIcons_?"width: "+this.width_+"px;height: "+this.height_+"px;":"clip: rect("+-1*spriteV+"px, "+(-1*spriteH+this.width_)+"px, "+(-1*spriteV+this.height_)+"px, "+-1*spriteH+"px);",img+="'>",this.div_.innerHTML=img+"<div style='position: absolute;top: "+this.anchorText_[0]+"px;left: "+this.anchorText_[1]+"px;color: "+this.textColor_+";font-size: "+this.textSize_+"px;font-family: "+this.fontFamily_+";font-weight: "+this.fontWeight_+";font-style: "+this.fontStyle_+";text-decoration: "+this.textDecoration_+";text-align: center;width: "+this.width_+"px;line-height:"+this.height_+"px;'>"+(this.cluster_.hideLabel_?" ":this.sums_.text)+"</div>",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display=""}this.visible_=!0},ClusterIcon.prototype.useStyle=function(sums){this.sums_=sums;var index=Math.max(0,sums.index-1);index=Math.min(this.styles_.length-1,index);var style=this.styles_[index];this.url_=style.url,this.height_=style.height,this.width_=style.width,this.anchorText_=style.anchorText||[0,0],this.anchorIcon_=style.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=style.textColor||"black",this.textSize_=style.textSize||11,this.textDecoration_=style.textDecoration||"none",this.fontWeight_=style.fontWeight||"bold",this.fontStyle_=style.fontStyle||"normal",this.fontFamily_=style.fontFamily||"Arial,sans-serif",this.backgroundPosition_=style.backgroundPosition||"0 0"},ClusterIcon.prototype.setCenter=function(center){this.center_=center},ClusterIcon.prototype.createCss=function(pos){var style=[];return style.push("cursor: pointer;"),style.push("position: absolute; top: "+pos.y+"px; left: "+pos.x+"px;"),style.push("width: "+this.width_+"px; height: "+this.height_+"px;"),style.join("")},ClusterIcon.prototype.getPosFromLatLng_=function(latlng){var pos=this.getProjection().fromLatLngToDivPixel(latlng);return pos.x-=this.anchorIcon_[1],pos.y-=this.anchorIcon_[0],pos.x=parseInt(pos.x,
110),pos.y=parseInt(pos.y,10),pos},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){var i,bounds=new google.maps.LatLngBounds(this.center_,this.center_),markers=this.getMarkers();for(i=0;i<markers.length;i++)bounds.extend(markers[i].getPosition());return bounds},Cluster.prototype.remove=function(){this.clusterIcon_.setMap(null),this.markers_=[],delete this.markers_},Cluster.prototype.addMarker=function(marker){var i,mCount,mz;if(this.isMarkerAlreadyAdded_(marker))return!1;if(this.center_){if(this.averageCenter_){var l=this.markers_.length+1,lat=(this.center_.lat()*(l-1)+marker.getPosition().lat())/l,lng=(this.center_.lng()*(l-1)+marker.getPosition().lng())/l;this.center_=new google.maps.LatLng(lat,lng),this.calculateBounds_()}}else this.center_=marker.getPosition(),this.calculateBounds_();if(marker.isAdded=!0,this.markers_.push(marker),mCount=this.markers_.length,mz=this.markerClusterer_.getMaxZoom(),null!==mz&&this.map_.getZoom()>mz)marker.getMap()!==this.map_&&marker.setMap(this.map_);else if(mCount<this.minClusterSize_)marker.getMap()!==this.map_&&marker.setMap(this.map_);else if(mCount===this.minClusterSize_)for(i=0;mCount>i;i++)this.markers_[i].setMap(null);else marker.setMap(null);return!0},Cluster.prototype.isMarkerInClusterBounds=function(marker){return this.bounds_.contains(marker.getPosition())},Cluster.prototype.calculateBounds_=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(bounds)},Cluster.prototype.updateIcon_=function(){var mCount=this.markers_.length,mz=this.markerClusterer_.getMaxZoom();if(null!==mz&&this.map_.getZoom()>mz)return void this.clusterIcon_.hide();if(mCount<this.minClusterSize_)return void this.clusterIcon_.hide();var numStyles=this.markerClusterer_.getStyles().length,sums=this.markerClusterer_.getCalculator()(this.markers_,numStyles);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.useStyle(sums),this.clusterIcon_.show()},Cluster.prototype.isMarkerAlreadyAdded_=function(marker){for(var i=0,n=this.markers_.length;n>i;i++)if(marker===this.markers_[i])return!0;return!1},MarkerClusterer.prototype.onAdd=function(){var cMarkerClusterer=this;this.activeMap_=this.getMap(),this.ready_=!0,this.repaint(),this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){cMarkerClusterer.resetViewport_(!1),(this.getZoom()===(this.get("minZoom")||0)||this.getZoom()===this.get("maxZoom"))&&google.maps.event.trigger(this,"idle")}),google.maps.event.addListener(this.getMap(),"idle",function(){cMarkerClusterer.redraw_()})]},MarkerClusterer.prototype.onRemove=function(){var i;for(i=0;i<this.markers_.length;i++)this.markers_[i].getMap()!==this.activeMap_&&this.markers_[i].setMap(this.activeMap_);for(i=0;
1i<this.clusters_.length;i++)this.clusters_[i].remove();for(this.clusters_=[],i=0;i<this.listeners_.length;i++)google.maps.event.removeListener(this.listeners_[i]);this.listeners_=[],this.activeMap_=null,this.ready_=!1},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){var i,size;if(!(this.styles_.length>0))for(i=0;i<this.imageSizes_.length;i++)size=this.imageSizes_[i],this.styles_.push({url:this.imagePath_+(i+1)+"."+this.imageExtension_,height:size,width:size})},MarkerClusterer.prototype.fitMapToMarkers=function(){var i,markers=this.getMarkers(),bounds=new google.maps.LatLngBounds;for(i=0;i<markers.length;i++)bounds.extend(markers[i].getPosition());this.getMap().fitBounds(bounds)},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(gridSize){this.gridSize_=gridSize},MarkerClusterer.prototype.getMinimumClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinimumClusterSize=function(minimumClusterSize){this.minClusterSize_=minimumClusterSize},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.setMaxZoom=function(maxZoom){this.maxZoom_=maxZoom},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.setStyles=function(styles){this.styles_=styles},MarkerClusterer.prototype.getTitle=function(){return this.title_},MarkerClusterer.prototype.setTitle=function(title){this.title_=title},MarkerClusterer.prototype.getZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.setZoomOnClick=function(zoomOnClick){this.zoomOnClick_=zoomOnClick},MarkerClusterer.prototype.getAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.setAverageCenter=function(averageCenter){this.averageCenter_=averageCenter},MarkerClusterer.prototype.getIgnoreHidden=function(){return this.ignoreHidden_},MarkerClusterer.prototype.setIgnoreHidden=function(ignoreHidden){this.ignoreHidden_=ignoreHidden},MarkerClusterer.prototype.getEnableRetinaIcons=function(){return this.enableRetinaIcons_},MarkerClusterer.prototype.setEnableRetinaIcons=function(enableRetinaIcons){this.enableRetinaIcons_=enableRetinaIcons},MarkerClusterer.prototype.getImageExtension=function(){return this.imageExtension_},MarkerClusterer.prototype.setImageExtension=function(imageExtension){this.imageExtension_=imageExtension},MarkerClusterer.prototype.getImagePath=function(){return this.imagePath_},MarkerClusterer.prototype.setImagePath=function(imagePath){this.imagePath_=imagePath},MarkerClusterer.prototype.getImageSizes=function(){return this.imageSizes_},MarkerClusterer.prototype.setImageSizes=function(imageSizes){this.imageSizes_=imageSizes},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.setCalculator=function(calculator){this.calculator_=calculator},MarkerClusterer.prototype.setHideLabel=function(hideLabel){this.hideLabel_=hideLabel},MarkerClusterer.prototype.getHideLabel=function(){return this.hideLabel_},MarkerClusterer.prototype.getBatchSizeIE=function(){return this.batchSizeIE_},MarkerClusterer.prototype.setBatchSizeIE=function(batchSizeIE){this.batchSizeIE_=batchSizeIE},MarkerClusterer.prototype.getClusterClass=function(){return this.clusterClass_},MarkerClusterer.prototype.setClusterClass=function(clusterClass){this.clusterClass_=clusterClass},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.getClusters=function(){return this.clusters_},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.addMarker=function(marker,opt_nodraw){this.pushMarkerTo_(marker),opt_nodraw||this.redraw_()},MarkerClusterer.prototype.addMarkers=function(markers,opt_nodraw){var key;for(key in markers)markers.hasOwnProperty(key)&&this.pushMarkerTo_(markers[key]);opt_nodraw||this.redraw_()},MarkerClusterer.prototype.pushMarkerTo_=function(marker){if(marker.getDraggable()){var cMarkerClusterer=this;google.maps.event.addListener(marker,"dragend",function(){cMarkerClusterer.ready_&&(this.isAdded=!1,cMarkerClusterer.repaint())})}marker.isAdded=!1,this.markers_.push(marker)},MarkerClusterer.prototype.removeMarker=function(marker,opt_nodraw,opt_noMapRemove){var removeFromMap=!0&&!opt_noMapRemove,removed=this.removeMarker_(marker,removeFromMap);return!opt_nodraw&&removed&&this.repaint(),removed},MarkerClusterer.prototype.removeMarkers=function(markers,opt_nodraw,opt_noMapRemove){var i,r,removed=!1,removeFromMap=!0&&!opt_noMapRemove;for(i=0;i<markers.length;i++)r=this.removeMarker_(markers[i],removeFromMap),removed=removed||r;return!opt_nodraw&&removed&&this.repaint(),removed},MarkerClusterer.prototype.removeMarker_=function(marker,removeFromMap){var i,index=-1;if(this.markers_.indexOf)index=this.markers_.indexOf(marker);else for(i=0;i<this.markers_.length;i++)if(marker===this.markers_[i]){index=i;break}return-1===index?!1:(removeFromMap&&marker.setMap(null),this.markers_.splice(index,1),!0)},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport_(!0),this.markers_=[]},MarkerClusterer.prototype.repaint=function(){var oldClusters=this.cluster
1s_.slice();this.clusters_=[],this.resetViewport_(!1),this.redraw_(),setTimeout(function(){var i;for(i=0;i<oldClusters.length;i++)oldClusters[i].remove()},0)},MarkerClusterer.prototype.getExtendedBounds=function(bounds){var projection=this.getProjection(),tr=new google.maps.LatLng(bounds.getNorthEast().lat(),bounds.getNorthEast().lng()),bl=new google.maps.LatLng(bounds.getSouthWest().lat(),bounds.getSouthWest().lng()),trPix=projection.fromLatLngToDivPixel(tr);trPix.x+=this.gridSize_,trPix.y-=this.gridSize_;var blPix=projection.fromLatLngToDivPixel(bl);blPix.x-=this.gridSize_,blPix.y+=this.gridSize_;var ne=projection.fromDivPixelToLatLng(trPix),sw=projection.fromDivPixelToLatLng(blPix);return bounds.extend(ne),bounds.extend(sw),bounds},MarkerClusterer.prototype.redraw_=function(){this.createClusters_(0)},MarkerClusterer.prototype.resetViewport_=function(opt_hide){var i,marker;for(i=0;i<this.clusters_.length;i++)this.clusters_[i].remove();for(this.clusters_=[],i=0;i<this.markers_.length;i++)marker=this.markers_[i],marker.isAdded=!1,opt_hide&&marker.setMap(null)},MarkerClusterer.prototype.distanceBetweenPoints_=function(p1,p2){var R=6371,dLat=(p2.lat()-p1.lat())*Math.PI/180,dLon=(p2.lng()-p1.lng())*Math.PI/180,a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(p1.lat()*Math.PI/180)*Math.cos(p2.lat()*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2),c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),d=R*c;return d},MarkerClusterer.prototype.isMarkerInBounds_=function(marker,bounds){return bounds.contains(marker.getPosition())},MarkerClusterer.prototype.addToClosestCluster_=function(marker){var i,d,cluster,center,distance=4e4,clusterToAddTo=null;for(i=0;
1i<this.clusters_.length;i++)cluster=this.clusters_[i],center=cluster.getCenter(),center&&(d=this.distanceBetweenPoints_(center,marker.getPosition()),distance>d&&(distance=d,clusterToAddTo=cluster));clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)?clusterToAddTo.addMarker(marker):(cluster=new Cluster(this),cluster.addMarker(marker),this.clusters_.push(cluster))},MarkerClusterer.prototype.createClusters_=function(iFirst){var i,marker,mapBounds,cMarkerClusterer=this;if(this.ready_){0===iFirst&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),mapBounds=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var bounds=this.getExtendedBounds(mapBounds),iLast=Math.min(iFirst+this.batchSize_,this.markers_.length);for(i=iFirst;iLast>i;i++)marker=this.markers_[i],!marker.isAdded&&this.isMarkerInBounds_(marker,bounds)&&(!this.ignoreHidden_||this.ignoreHidden_&&marker.getVisible())&&this.addToClosestCluster_(marker);if(iLast<this.markers_.length)this.timerRefStatic=setTimeout(function(){cMarkerClusterer.createClusters_(iLast)},0);else for(delete this.timerRefStatic,google.maps.event.trigger(this,"clusteringend",this),i=0;
1i<this.clusters_.length;i++)this.clusters_[i].updateIcon_()}},MarkerClusterer.prototype.extend=function(obj1,obj2){return function(object){var property;for(property in object.prototype)this.prototype[property]=object.prototype[property];return this}.apply(obj1,[obj2])},MarkerClusterer.CALCULATOR=function(markers,numStyles){for(var index=0,title="",count=markers.length.toString(),dv=count;0!==dv;)dv=parseInt(dv/10,10),index++;return index=Math.min(index,numStyles),{text:count,index:index,title:title}},MarkerClusterer.BATCH_SIZE=2e3,MarkerClusterer.BATCH_SIZE_IE=500,MarkerClusterer.IMAGE_PATH="/assets/design/icons/cluster/m",MarkerClusterer.IMAGE_EXTENSION="png",MarkerClusterer.IMAGE_SIZES=[53,56,66,78,90],"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var customLabelOverlays={};function CustomLabelOverlay(position,text,map){this.position=position;this.text=text;this.div=null;this.setMap(map);}
2CustomLabelOverlay.prototype=new google.maps.OverlayView();CustomLabelOverlay.prototype.onAdd=function(){var div=document.createElement('div');div.style.position='absolute';div.style.whiteSpace='nowrap';div.style.background='rgba(0,0,0,0.5)';div.style.padding='2px 4px';div.style.borderRadius='2px';div.style.fontSize='12px';div.style.color='#fff';div.style.transform='translate(-50%, 0)';div.style.pointerEvents='none';div.style.display='none';div.innerHTML=this.text.substring(0,30)+(this.text.length>30?"...":"");this.div=div;var panes=this.getPanes();panes.overlayLayer.appendChild(div);};CustomLabelOverlay.prototype.draw=function(){var overlayProjection=this.getProjection();var pos=overlayProjection.fromLatLngToDivPixel(this.position);if(this.div){this.div.style.left=pos.x+'px';this.div.style.top=(pos.y+5)+'px';}};CustomLabelOverlay.prototype.onRemove=function(){if(this.div){this.div.parentNode.removeChild(this.div);this.div=null;}};$(document).ready(function(){$('[data-action="toggle-map-options"]').click(function(){var controls=$(this).attr('aria-controls');var expanded=$(this).attr('aria-expanded');if(expanded==="false"){$(this).attr('aria-expanded','true');$('#'+controls).attr('data-expanded','true');}else{$(this).attr('aria-expanded','false');$('#'+controls).attr('data-expanded','false');}
3return false;});var marker_selected=null;var autozoom=false;$.widget("custom.mapsuggest",$.ui.autocomplete,{_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){if(item.type==='item'){item.content='<b class="suggest__label">'+
4'<strong class="suggest__title">'+item.title+'</strong>'+
5'<address class="suggest__address">'+item.address+'</address>'+
6'</b>';}else{item.content='<b class="suggest__label">'+item.title+'</b>';}
7item.content='<i class="suggest__icon"></i>'+item.content;return $("<li></li>").data("item.autocomplete",item).append('<a href="'+item.url+'">'+item.content+'</a>').addClass('suggest--'+item.type).addClass('category--'+item.category).appendTo(ul);}});function sortByKey(array,key){return array.sort(function(a,b){var x=a[key];var y=b[key];return((x<y)?-1:((x>y)?1:0));});}
8var selectedSuggestItem=false;function autocomplete_init(search_id){var form_id=search_id+'-form';var input_id=search_id+'-input';var suggest_id=search_id+'-suggest';var file=$('#'+form_id).find('input[name="file"]').val();var id=$('#'+form_id).find('input[name="id"]').val();var suggest_lookup=$('#'+form_id).find('input[name="suggest_lookup"]').val();var language=$('#'+form_id).find('input[name="language"]').val();var type,query,place,item;var mapsuggest=$('#'+input_id).mapsuggest({sourceXXX:function(request,response){$.getJSON(source,{file:file,id:id,query:query,place:place,item:item},response);},source:function(request,response){var areas=[];var has_areas=false;if(SUGGEST_PLACES[suggest_lookup]){areas=SUGGEST_PLACES[suggest_lookup];has_areas=areas.length>0;}
9sortByKey(areas,"title");var markers=SUGGEST_MARKERS[suggest_lookup];sortByKey(markers,"title");var suggest=areas.concat(markers);function place_item(item){var _title=item.title||item.label;if(language==="en"&&item.subtype==="region"){_title=region["en"][item.title];}
10return{title:_title,id:item.id,place:item.id,type:item.type,subtype:item.subtype||'place',descr:"",item:item,url:"#"};};function dimu_item(item){var title;if(language=='no'){title=item.no_headline||item['artifact.ingress.title']||item.title;}else{title=item.en_headline||item['artifact.ingress.title']||item.title;}
11return{title:title,place:item.place,id:item.id,type:"item",address:(item.address||'')+' '+(item.place_description||item.place||''),subtype:item.type,item:item,url:'#'};};function m24_item(item){return{title:item.title,id:item.id,place:item.title,address:item.address||"",type:"item",subtype:item.subtype||"",source:item.source||'m24',descr:"",item:item,url:"#"};};var norway={"no":"Norge","en":"Norway"};var region={"no":{"Nord-Norge":"Nord-Norge","Sørlandet":"Sørlandet","Trøndelag":"Trøndelag","Midt-Norge":"Midt-Norge","Vestlandet":"Vestlandet","Østlandet":"Østlandet"},"en":{"Nord-Norge":"The north of Norway","Sørlandet":"The South coast of Norway","Trøndelag":"Mid-Norway","Midt-Norge":"Mid-Norway","Vestlandet":"The west of Norway","Østlandet":"The eastern part of southern Norway"}};var place=$('#'+form_id).find('input[name="place"]').val();var _response=$.map(suggest,function(item){query=query.toLowerCase()||'';if(place){place=(place.toLowerCase()||'');}else{place='';}
12if(query==''&&place==''){if(has_areas){if(item.subtype&&item.subtype=='region'){return place_item(item);}}
13if(!has_areas){return m24_item(item);}}
14if(query==''&&place!=''){if(item.type==='place'){if(selectedSuggestItem){if((selectedSuggestItem.subtype==='region')&&(item.subtype==='region'||!item.subtype)){return;}
15if(selectedSuggestItem.subtype==='state'&&item.subtype==='state'){return;}}
16if(item.id&&item.id.toString().toLowerCase().indexOf(place)!==-1){return place_item(item);}}
17if(!has_areas){if(item.type==='item'){return m24_item(item);}}}
18if(item.type==='item'&&query==''&&selectedSuggestItem&&selectedSuggestItem.place&&item.place){if(selectedSuggestItem.subtype==='place'&&item.place.toLowerCase().indexOf(selectedSuggestItem.place.toLowerCase())!==-1){return dimu_item(item);}}
19if(query!=''){if(has_areas&&item.type==='place'){if((item.id&&item.id.toString().toLowerCase().indexOf(query)!==-1)){return place_item(item);}}
20if(item.source==='dimu'){if((item['artifact.ingress.title']&&item['artifact.ingress.title'].toLowerCase().indexOf(query)!==-1)||(item.place&&item.place.toLowerCase().indexOf(query)!==-1)){return dimu_item(item);}}
21if(item.source!=='dimu'){if((item.place&&item.place.toString().toLowerCase().indexOf(query)!==-1)){return m24_item(item);}}}});if(has_areas&&query==''){if(selectedSuggestItem&&(selectedSuggestItem.type==='place'||selectedSuggestItem.type==='parent')){placearray=selectedSuggestItem.id.split("/");if(selectedSuggestItem.subtype==='region'&&language==='no'){_response.unshift({title:placearray[1],id:""+placearray[0]+"/"+placearray[1]+"",type:"parent",subtype:"region",url:'#'});_response.unshift({title:norway[language],id:"",type:"root",url:'#'});}
22if(selectedSuggestItem.subtype==='region'&&language==='en'){_response.unshift({title:region[language][placearray[1]],id:""+placearray[0]+"/"+placearray[1]+"",type:"parent",subtype:"region",url:'#'});_response.unshift({title:norway[language],id:"",type:"root",url:'#'});}
23if(selectedSuggestItem.subtype==='state'){_response.unshift({title:placearray[2],id:""+placearray[0]+"/"+placearray[1]+"/"+placearray[2]+"",type:"parent",subtype:"state",url:'#'});_response.unshift({title:placearray[1],id:""+placearray[0]+"/"+placearray[1]+"",type:"parent",subtype:"region",url:'#'});_response.unshift({title:norway[language],id:"",type:"root",subtype:"",url:'#'});}
24if(selectedSuggestItem.subtype==='place'){_response.unshift({title:placearray[2],id:""+placearray[0]+"/"+placearray[1]+"/"+placearray[2]+"",type:"parent",subtype:"state",url:'#'});_response.unshift({title:placearray[1],id:""+placearray[0]+"/"+placearray[1]+"",type:"parent",subtype:"region",url:'#'});_response.unshift({title:norway[language],id:"",type:"root",url:'#'});}}
25if(selectedSuggestItem&&(selectedSuggestItem.type==='item')){placearray=selectedSuggestItem.place.split("/");_response.unshift({title:placearray[3],id:""+placearray[0]+"/"+placearray[1]+"/"+placearray[2]+"/"+placearray[3]+"",type:"parent",subtype:"place",url:'#'});_response.unshift({title:placearray[2],id:""+placearray[0]+"/"+placearray[1]+"/"+placearray[2]+"",type:"parent",subtype:"state",url:'#'});_response.unshift({title:placearray[1],id:""+placearray[0]+"/"+placearray[1]+"",type:"parent",subtype:"region",url:'#'});_response.unshift({title:"Norge",id:"",type:"root"});}}
26if(!has_areas&&language==="no"){_response.unshift({title:"Vis alle",id:"",type:"root",url:'#'});}
27if(!has_areas&&language!=="no"){_response.unshift({title:"Show all",id:"",type:"root",url:'#'});}
28if(has_areas&&_response.length=='0'&&query!=''&&language!=="no"){_response.unshift({title:"All places",id:"",type:"root",url:'#'});}
29if(has_areas&&_response.length=='0'&&query!=''&&language=="no"){_response.unshift({title:"Alle steder",id:"",type:"root",url:'#'});}
30response(_response);},delay:250,appendTo:$('#'+suggest_id),create:function(event,ui){},search:function(event,ui){query=$(this).val();},open:function(event,ui){$('.ui-autocomplete').css({'width':'100% '});$('.ui-autocomplete').css({'left':'0'});$('.ui-autocomplete').css({'right':'0'});},focus:function(event,ui){},change:function(event,ui){},select:function(event,ui){selectedSuggestItem=ui.item;if(ui.item.type==='root'){query='';place='';item='';}else if(ui.item.type==='parent'){query='';place=ui.item.id;item='';}else if(ui.item.type==='place'){query='';place=ui.item.id;item='';}else if(ui.item.type==='item'){query=ui.item.title;place=ui.item.place;item=ui.item.id;}else{}
31},close:function(event,ui){if(!item&&place){}else{}
32$('#'+form_id).find('input[name="place"]').val(place);$('#'+form_id).find('input[name="item"]').val(item);if(item){}
33},});$('#'+input_id).click(function(){if(place||item){$(this).val('');}
34$(this).mapsuggest('search','default');});$('#'+input_id).focusin(function(){});$('#'+input_id).focusout(function(){if(!query&&place){var places=place.split('/');query=places[(places.length)-1];$(this).val(query);}else if(!item){$(this).val('');$(this).parent().removeAttr('data-value');}
35if(query){$(this).parent().attr('data-value',query);}else{$(this).parent().removeAttr('data-value');}
36});return mapsuggest;}
37function map_info_reset(mapid){if(marker_selected){marker_selected.setIcon(marker_selected.icon_default);}
38marker_selected=null;map_module_collapse(mapid);map_sidebar_hide(mapid);}
39function map_info(mapid,map,marker){var id=marker.id;if(window.location.hash){window.location=window.location.href.replace(location.hash,'')+"#"+marker.oid;}else{window.location=window.location.href+"#"+marker.oid;}
40if(marker_selected===marker){map_info_reset(mapid);return false;}else if(marker_selected){marker_selected.setIcon(marker_selected.icon_default);}
41marker_selected=marker;marker_selected.setIcon(marker.icon_selected);var form_input=mapid+'-search-input';var form_id=mapid+'-search-form';$('#'+form_id).find('input[name="place"]').val(marker.place);$('#'+form_id).find('input[name="item"]').val(marker.id);$('#'+form_id).find('input[name="q"]').val(marker.title);var html="";if(marker.dynamic){sidebarTemplate=$("#"+mapid).find('[data-js-template="map-sidebar"]').html();html=setSidebarHtml(marker,sidebarTemplate);}
42else{var markerdata=$('#'+id);var markerimg=markerdata.find(".sidebarimage");var imgdatasrc=markerimg.data("img-src");markerimg.attr("src",imgdatasrc);html=markerdata.html();}
43map_sidebar_show(mapid,html);}
44setSidebarHtml=function(marker,template){var item=marker.item;var html=template;
44var title,descr,img;title=item.title;descr=item.descr||"";img="/assets/design/img/blank.png";if(item.img){img=item.img.replace("mm.","ems.").replace(/dms-cf-0[1-9]/,"ems").replace("dms-cf-10","ems").replace(/dms0[1-9]/,"ems").replace("dms10","ems")+"?dimension=400x400";}
45html=html.replace(/## type ##/gi,item.type);html=html.replace(/## skin ##/gi,item.skin);html=html.replace(/## i ##/gi,item['skin-i']);html=html.replace(/## label ##/gi,item.label);var url=item.url;var target="_self";if(item.url&&item.url!=="#"&&item.url.indexOf("https")===-1){url="//"+item.url;}
46if(url.indexOf("?kp_id")!==-1){url=item.url;}
47if(url.indexOf("https")!==-1){target="newtab";}
48if(url.indexOf("kulturpunkt")!==-1){target="kulturpunkt";}
49if(url.indexOf("digitaltmuseum")!==-1){target="digitaltmuseum";}
50html=html.replace(/## target ##/gi,target);html=html.replace(/## url ##/gi,url);html=html.replace(/## img ##/gi,img);html=html.replace(/## icon ##/gi,item.symbol);html=html.replace(/## title ##/gi,title);html=html.replace(/## descr ##/gi,descr);html=html.replace(/## descrShort ##/gi,descr.substring(0,400)+" ...");html=html.replace(/## address ##/gi,item.address);var directionsUrl="https://www.google.com/maps/dir//"+item.lat+","+item.lng;html=html.replace(/## directions ##/gi,directionsUrl);return html;}
51function map_sidebar_show(mapid,html){var sidebar=$('#'+mapid+'-sidebar');if(html){sidebar.html(html);}
52sidebar.attr('aria-hidden','false');}
53function map_sidebar_hide(mapid){var sidebar=$('#'+mapid+'-sidebar');sidebar.attr('aria-hidden','true');sidebar.html('');history.replaceState("",document.title,window.location.pathname+window.location.search);reset_marker();}
54function reset_marker(){}
55function map_module_expand(mapid){var sidebar=$('#'+mapid+'-sidebar');var module=sidebar.find('.module--map');module.attr('aria-expanded','true');}
56function map_module_collapse(mapid){var sidebar=$('#'+mapid+'-sidebar');var module=sidebar.find('.module--map');module.attr('aria-expanded','false');}
57function map_search_reset(mapid,map,markers,cluster){var form_input=mapid+'-search-input';var form_id=mapid+'-search-form';$('#'+form_id).find('input[name="place"]').val('');$('#'+form_id).find('input[name="item"]').val('');$('#'+form_id).find('input[name="q"]').val('');selectedSuggestItem=false;markers=map_filter_reset(map,markers);map_update_cluster(map,cluster,markers);$('#'+form_id).find('input[name="q"]').parent().removeAttr('data-value');map_sidebar_hide(mapid);if(marker_selected){marker_selected.setIcon(marker_selected.icon_default);marker_selected=null;}}
58function map_markers(mapid,map,preselectMarkerID,dynamicData,dynamicDataSource,sidebartemplate,oms){var suggest_lookup=$('#'+mapid).find('input[name="suggest_lookup"]').val();var language=$('#'+mapid).attr('data-page-language');var readmoreUrl=$('#'+mapid).attr('data-dynamic-markers-readmore');var map_options_id=$('#'+mapid).attr('data-map-options-id');if(readmoreUrl=='false'){readmoreUrl=false;}
59var markers=[];var bounds=new google.maps.LatLngBounds();var openmarkerObj=false;var m=$('#'+mapid);var manualZoom=m.data('map-zoom-option');var enableLabel=m.data('map-enable-label');var normalizedData=[];if(dynamicData){if(dynamicDataSource=="digitaltmuseum"){if(dynamicData.response&&dynamicData.response.docs){dynamicData.response.docs.map(function(item){var normalizedItem={};if(item['artifact.coordinate']){normalizedItem.lat=item['artifact.coordinate'].split(",")[0];normalizedItem.lng=item['artifact.coordinate'].split(",")[1];normalizedItem.label=item['no_headline']||item['artifact.ingress.title'];normalizedItem.title=normalizedItem.label;normalizedItem.place=item['artifact.ingress.production.place']||"";normalizedItem.address=normalizedItem.place;normalizedItem.id=item['artifact.uniqueId'];normalizedItem.oid=item['artifact.uniqueId'];normalizedItem.category="digitaltMuseum";normalizedItem.subtype=item['artifact.subtype']||'';normalizedItem.ownerCode=item['identifier.owner']||'';normalizedItem.dynamic=true;normalizedItem.url=(readmoreUrl||"https://digitaltmuseum.org")+"/"+item['artifact.uniqueId'];if(normalizedItem.subtype=='museum'){normalizedItem.url=(readmoreUrl||"https://digitaltmuseum.org")+"/"+normalizedItem.ownerCode;}
60normalizedItem.source='dimu';normalizedItem.type='item';if(item['artifact.defaultMediaIdentifier']){normalizedItem.img="https://mm.dimu.org/image/"+item['artifact.defaultMediaIdentifier'];}
61normalizedItem.skin="skin-dm";normalizedItem.descr=item['artifact.ingress.description']||"";normalizedData.push(normalizedItem);}});};};if(dynamicDataSource==="minner"){if(dynamicData.responses){dynamicData.responses.map(function(item){var normalizedItem={};if(item.latitude){normalizedItem.lat=item.latitude;normalizedItem.lng=item.longitude;normalizedItem.label=(item.slogan.substring(0,35)||"Untitled")+"..";if(item.title.sv_se&&item.title.sv_se.length>0){normalizedItem.label=item.title.sv_se;}
62if(item.title.nb_no&&item.title.nb_no.length>0){normalizedItem.label=item.title.nb_no;}
63normalizedItem.title=normalizedItem.label;normalizedItem.place=normalizedItem.label;normalizedItem.address=item.topic_name;normalizedItem.id=item.id;normalizedItem.oid=item.id;normalizedItem.category=item.topic_id;normalizedItem.dynamic=true;normalizedItem.url=item.url;normalizedItem.source='minner';normalizedItem.type='item';normalizedItem.img=item.dms_url;
63normalizedItem.skin="skin skin-topic-"+item.topic_id;normalizedItem.descr=item.slogan;normalizedData.push(normalizedItem);}});};};if(dynamicDataSource==="kulturnav"){if(dynamicData.features){dynamicData.features.map(function(item){var normalizedItem={};if(item.geometry){normalizedItem.lat=item.geometry.coordinates[1];normalizedItem.lng=item.geometry.coordinates[0];normalizedItem.label=item.properties.caption;normalizedItem.title=item.properties.caption;normalizedItem.address=item.properties.containerCaption;normalizedItem.place=item.properties.caption+" "+item.properties.containerCaption+" :"+item.properties['investigation.id'];normalizedItem.id=item.properties.uuid;normalizedItem.oid=item.properties.uuid;normalizedItem.categroy=item.properties.entityType;normalizedItem.dynamic=true;normalizedItem.url=(readmoreUrl||"https://data.arkeologi.org")+"/"+item.properties.uuid;normalizedItem.source='kulturnav';normalizedItem.type='item';normalizedItem.descr=item.properties.entityTypeLabel+"/"+item.properties['investigation.id']+"/"+item.properties.begin+"–"+item.properties.begin;;normalizedItem.skin="skin skin-"+item.properties.entityType;normalizedData.push(normalizedItem);}});};};if(dynamicDataSource==="kulturpunkt"){if(dynamicData){dynamicData.map(function(item){var normalizedItem={};if((item.status=='published'||item.status=='published_not_listed')&&item.location&&item.location.lat){normalizedItem.lat=item.location.lat;normalizedItem.lng=item.location.lng;normalizedItem.label=item.title?(item.title[language]||""):(item.title||item.internal_title||"");normalizedItem.title=item.title?(item.title[language]||""):(item.title||item.internal_title||"");normalizedItem.place="";normalizedItem.address="";normalizedItem.id=item.document_id;normalizedItem.oid=item.document_id;normalizedItem.dynamic=true;normalizedItem.url=readmoreUrl+""+item.document_id;normalizedItem.category="kulturpunkt";normalizedItem.source='kulturpunkt';if(item.image_src){normalizedItem.img=item.image_src;}
64normalizedItem.type='item';normalizedItem.descr=item.description?item.description[language]:"";normalizedItem.skin="skin";normalizedData.push(normalizedItem);}});};}};m.find('.map__item').each(function(){var normalizedItem={};normalizedItem.lat=$(this).data('lat');normalizedItem.lng=$(this).data('long');normalizedItem.label=$(this).data('title');normalizedItem.title=$(this).data('title');normalizedItem.place=$(this).data('place');normalizedItem.id=$(this).attr('id');normalizedItem.oid=$(this).data('oid');normalizedItem.category=$(this).data('cat');normalizedItem.dynamic=false;normalizedData.push(normalizedItem);});var checkLatLong={};normalizedData.map(function(item){if(item.category&&category_icons[map_options_id][item.category]){var icon_default=category_icons[map_options_id][item.category];var icon_selected=category_icons[map_options_id][item.category+"_selected"];icon_default=new google.maps.MarkerImage(icon_default+'?mediaType=image/png',null,null,new google.maps.Point(12,36),new google.maps.Size(36,36));icon_selected=new google.maps.MarkerImage(icon_selected+'?mediaType=image/png',null,null,new google.maps.Point(12,36),new google.maps.Size(36,36));}else{var icon_default=category_icons[map_options_id].default;var icon_selected=category_icons[map_options_id].default_selected;}
65var latLng=new google.maps.LatLng(item.lat,item.lng);var hasUniquePosition=true;if(!checkLatLong[latLng]){checkLatLong[latLng]=true;}else{hasUniquePosition=false;}
66var marker;if(item.dynamic&&normalizedData.length>200){marker=new google.maps.Marker({map:map,position:latLng,icon:icon_default,});}else{if(enableLabel){marker=new google.maps.Marker({map:map,title:item.label,position:latLng,icon:icon_default});var labelOverlay=new CustomLabelOverlay(latLng,item.label,map);customLabelOverlays[mapid].push(labelOverlay);}else{marker=new google.maps.Marker({map:map,title:item.label,position:latLng,icon:icon_default,});}}
67marker.id=item.id;marker.oid=item.oid;marker.title=item.label;marker.place=item.place||"";marker.address=item.address||"";marker.category=item.category||"";marker.source=item.source||"";marker.dynamic=item.dynamic;if(marker.dynamic){marker.item=item;}
68marker.icon_default=icon_default;marker.icon_selected=icon_selected;markers.push(marker);
68bounds.extend(marker.position);if(oms){google.maps.event.addListener(marker,'spider_click',function(){$('#'+mapid).find(".input--search").attr('data-value',marker.title);map_info(mapid,map,marker);});oms.addMarker(marker);}else{google.maps.event.addListener(marker,'click',function(){$('#'+mapid).find(".input--search").attr('data-value',marker.title);map_info(mapid,map,marker);});}
69if(preselectMarkerID&&preselectMarkerID==marker.oid){openmarkerObj=marker;}});if(manualZoom!=='manuel'&&markers.length>1){if(!openmarkerObj){map.fitBounds(bounds);}}
70if(manualZoom!=='manuel'&&markers.length===1){map.panTo(markers[0].getPosition());map.setZoom(12);}
71if(openmarkerObj){if(oms){google.maps.event.trigger(openmarkerObj,'spider_click');}else{google.maps.event.trigger(openmarkerObj,'click');}
72map.panTo(openmarkerObj.getPosition());map.setZoom(12);openmarkerObj.setAnimation(google.maps.Animation.DROP);openmarkerObj=false;}
73if(suggest_lookup){SUGGEST_MARKERS[suggest_lookup]=markers;}
74return markers;}
75function map_cluster(map,markers,clusterOptions){if(map.cluster==="false"){return false;}
76var clusterer=new MarkerClusterer(map,markers,clusterOptions);clusterer.setCalculator(function(markers,clusterStyles){var index=0;var count=markers.length;var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++;}
77index=Math.min(index,clusterStyles);return{text:count,index:index};});return clusterer;}
78function map_update_cluster(map,cluster,markers){if(cluster){cluster.clearMarkers();cluster.addMarkers(markers);}}
79var preselectMarkerID=false;function map_init(mapid,dynamicData,dynamicDataSource){var map_canvas_id=mapid+'-canvas';var map_search_id=mapid+'-search';var map_controls_id=mapid+'-controls';var map_options_id=$('#'+mapid).attr('data-map-options-id');var mapOptions=MAP_OPTIONS[map_options_id];customLabelOverlays[mapid]=[];preselectMarkerID=false;if(window.location.hash){var hash=window.location.hash;preselectMarkerID=hash.replace("#",'');}
80var map=new google.maps.Map(document.getElementById(map_canvas_id),mapOptions);window.m24Maps=window.m24Maps||{};window.m24Maps[mapid]=map;var oms=new OverlappingMarkerSpiderfier(map,{markersWontMove:true,markersWontHide:true,basicFormatEvents:true,legWeight:1.5,circleFootSeparation:80,circleSpiralSwitchover:20,circleFootSeparation:80,keepSpiderfied:true});var clusterOptions=CLUSTER_OPTIONS[map_options_id]||false;var mapZoom=null;google.maps.event.addListenerOnce(map,'bounds_changed',function(){if(mapZoom!=map.getZoom()&&map.getZoom()>18){if(clusterOptions&&clusterOptions.maxZoom){map.setZoom(clusterOptions.maxZoom);}else{map.setZoom=(map.getZoom()-5);}}});google.maps.event.addListenerOnce(map,'idle',function(){setTimeout(function(){const bbw=document.querySelector('.gm-style-mtc-bbw');if(bbw){bbw.removeAttribute('role');bbw.removeAttribute('aria-label');bbw.querySelectorAll('.gm-style-mtc').forEach(mtc=>{mtc.setAttribute('role','menubar');mtc.setAttribute('aria-label','Map Type Selector');Array.from(mtc.children).forEach(child=>{if(child.tagName==='BUTTON'){child.setAttribute('role','menuitemradio');}
81if(child.tagName==='UL'){child.setAttribute('role','menu');Array.from(child.children).forEach(li=>{if(li.tagName==='LI'){li.setAttribute('role','menuitemcheckbox');}});}});});}
82const scaleBtn=document.querySelector('button.gm-style-cc');if(scaleBtn){scaleObserver.observe(scaleBtn,{attributes:true,attributeFilter:['aria-label']});scaleBtn.setAttribute('aria-label',scaleBtn.innerText.trim());}},500);});const scaleObserver=new MutationObserver((mutations)=>{mutations.forEach((mutation)=>{const target=mutation.target;if(target.getAttribute('aria-label')?.includes('Map Scale')){const visibleText=target.innerText.replace(/\s+/g,' ').trim();scaleObserver.disconnect();target.setAttribute('aria-label',visibleText);scaleObserver.observe(target,{attributes:true,attributeFilter:['aria-label']});}});});var $map=$('#'+mapid);map.cluster=$map.attr('data-map-cluster');customLabelOverlays[mapid]=[];if(dynamicData!="false"){markers=map_markers(mapid,map,preselectMarkerID,dynamicData,dynamicDataSource,false,oms);}else{markers=map_markers(mapid,map,preselectMarkerID);}
83cluster=map_cluster(map,markers,clusterOptions);setTimeout(function(){setCustomLabelsVisible(mapid,markers,cluster);},500);var enableSearchStr=$map.attr('data-map-enable-search');var enableSearch=(enableSearchStr==='true');if(enableSearch){var mapsuggest=autocomplete_init(map_search_id);}
84var currentZoom=map.getZoom();var lastZoom=false;map.addListener('zoom_changed',function(){currentZoom=map.getZoom();setTimeout(function(){setCustomLabelsVisible(mapid,markers,cluster);},500);});map.addListener('dragend',function(){setTimeout(function(){setCustomLabelsVisible(mapid,markers,cluster);},500);});if(cluster){google.maps.event.addListener(cluster,'clusterclick',function(cluster){setTimeout(function(){setCustomLabelsVisible(mapid,markers,cluster);},1500);});}
85map.addListener('center_changed',function(){});$(document).on('fullscreen-toggle',function(event,id){if(id.indexOf("map")!==-1){google.maps.event.trigger(map,"resize");map_reset(mapid,map,markers,cluster);}});$(document).on('click','.nav-suggest a',function(event){event.preventDefault();map_filter(mapid,map,markers,cluster);});$(document).on('change','[data-action="filter-toggle"]',function(event){event.preventDefault();if($(this).prop('checked')){$(this).prop('checked',true);}
85else{$(this).prop('checked',false);}
86map_filter(mapid,map,markers,cluster);});$(document).on('click','[data-action="filter-select"]',function(event){if($('#'+mapid+' input[name="item"]').val()){$('#'+mapid+' input[name="item"]').val('');$('#'+mapid+' input[name="q"]').val('');selectedSuggestItem=false;$('#'+mapid+' input[name="place"]').val('');}
87event.preventDefault();var filter=$(this).attr('data-filter');$('.nav-filter input[type="checkbox"]').prop('checked',false);$('.nav-filter input[type="checkbox"]#'+filter).prop('checked',true);map_filter(mapid,map,markers,cluster);});$(document).on('click','[data-action="filter-reset"]',function(event){if($('#'+mapid+' input[name="item"]').val()){$('#'+mapid+' input[name="item"]').val('');$('#'+mapid+' input[name="q"]').val('');selectedSuggestItem=false;$('#'+mapid+' input[name="place"]').val('');}
88event.preventDefault();$('.nav-filter input[type="checkbox"]').prop('checked',true);map_filter(mapid,map,markers,cluster);});$(document).on('click','[data-action="map-search-submit"]',function(event){event.preventDefault();});$(document).on('click','[data-action="map-search-reset"]',function(event){event.preventDefault();map_search_reset(mapid,map,markers,cluster);return false;});$(document).on('click','[data-action="map-reset"]',function(event){event.preventDefault();$(this).parent().removeAttr('data-value');map_reset(mapid,map,markers,cluster);});$(document).on('click','[data-action="map-module-expand"]',function(event){event.preventDefault();map_module_expand(mapid);});$(document).on('click','[data-action="map-module-collapse"]',function(event){event.preventDefault();map_info_reset(mapid);});}
89function map_toggle_data(mapid,attribute){var toggle=$('#'+mapid).attr(attribute);if(toggle==="true"){$('#'+mapid).attr(attribute,'false');}else{$('#'+mapid).attr(attribute,'true');}}
90function map_reset(mapid,map,markers,cluster){$('.nav-filter input[type="checkbox"]').prop('checked',true);map_update_cluster(map,cluster,markers);map_search_reset(mapid,map,markers,cluster);$('#'+mapid).find('.map__item').show();}
91function map_select(map,markers,item){var markersFiltered=[];marker_selected=null;for(i=0;i<markers.length;i++){var marker=markers[i];if(item==marker.id||item==marker.oid){marker_selected=marker;marker.setVisible(true);markersFiltered.push(marker);}}
92return markersFiltered;}
93function map_filter(mapid,map,markers,cluster){var item=$('#'+mapid+' input[name="item"]').val();var place=$('#'+mapid+' input[name="place"]').val();var categories=$('#'+mapid+' input[name="category"]:checkbox:checked').map(function(){return $(this).val();}).get();if(item){marker=map_select(map,markers,item);map_update_bounds(map,marker);map_info(mapid,map,marker[0]);}
94if(!item){markersFiltered=map_filter_by_place(map,markers,place);map_update_bounds(map,markersFiltered);}
95var enableFacetsStr=$('#'+mapid).attr('data-map-enable-facets');var enableFacets=(enableFacetsStr==='true');if(enableFacets){markers=map_filter_by_categories(map,markers,categories);}
96map_update_cluster(map,cluster,markers);}
97function map_filter_reset(map,markers){for(var i=0;i<markers.length;i++){var marker=markers[i];marker.setVisible(true);}
98return markers;}
99function map_filter_by_place(map,markers,place){if(place===undefined){return markers;}
100var markersFiltered=[];for(i=0;i<markers.length;i++){var marker=markers[i];marker.setVisible(false);var facet=marker.place;if(facet.indexOf(place)>-1){marker.setVisible(true);markersFiltered.push(marker);}}
101return markersFiltered;}
102function map_filter_by_categories(map,markers,categories){var markersFiltered=[];for(i=0;i<markers.length;i++){var marker=markers[i];marker.setVisible(false);var facet=marker.category;for(c=0;c<categories.length;c++){var category=categories[c];if(facet.indexOf(category)>-1){marker.setVisible(true);markersFiltered.push(marker);}}}
103return markersFiltered;}
104function map_update_bounds(map,markers){autozoom=true;var bounds=new google.maps.LatLngBounds();for(i=0;i<markers.length;i++){var marker=markers[i];bounds.extend(marker.position);}
105map.fitBounds(bounds);autozoom=false;}
106$('.map').each(function(){var id=$(this).attr('id');var dynamicMarkersUrl=$(this).attr('data-dynamic-markers-url');var dynamicMarkersUrl2=$(this).attr('data-dynamic-markers-url2');var dynamicMarkersSource=$(this).attr('data-dynamic-markers-source');var requests=[];if(dynamicMarkersUrl!="False"){var request1=fetch(dynamicMarkersUrl,{cache:"no-cache"}).then(response=>response.json());requests.push(request1);if(dynamicMarkersUrl2!="False"){var request2=fetch(dynamicMarkersUrl2,{cache:"no-cache"}).then(response=>response.json());requests.push(request2);}
107Promise.all(requests).then((values)=>{if(values.length>1){var data=values[0].concat(values[1]);}else{var data=values[0];}
108map_init(id,data,dynamicMarkersSource);}).catch(error=>{map_init(id);});}else{map_init(id);}});});function setCustomLabelsVisible(mapid,markers,cluster){var map=null;if(markers&&markers.length>0&&markers[0].map){map=markers[0].map;}else if(customLabelOverlays[mapid]&&customLabelOverlays[mapid].length>0&&customLabelOverlays[mapid][0].map){map=customLabelOverlays[mapid][0].map;}
109if(map&&typeof map.getZoom==='function'){if(map.getZoom()<7){customLabelOverlays[mapid].forEac
109h(function(label){if(label.div)label.div.style.display='none';});return;}else if(map.getZoom()>=18){customLabelOverlays[mapid].forEach(function(label){if(label.div)label.div.style.display='block';});return;}}
110var visibleMarkers=new Set();if(cluster&&typeof cluster.getClusters==='function'){cluster.getClusters().forEach(function(c){if(c.getSize()===1){visibleMarkers.add(c.markers_[0]);}});}else{markers.forEach(function(m){if(m.getVisible())visibleMarkers.add(m);});}
111customLabelOverlays[mapid].forEach(function(label,idx){var marker=markers[idx];if(label.div&&marker){label.div.style.display=visibleMarkers.has(marker)?'block':'none';}});}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.