AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.112
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/dansnotreville-fr/nice/media/plg_system_nrframework/js/widgets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/dansnotreville-fr/nice/media/plg_system_nrframework/js/widgets/openstreetmap.js
var NR_OSM_Map=function(){function t(t){if(t){if(this.ref=t,this.wrapper=null,this.map_element=null,this.map=null,this.options={},this.markers_draggable=!1,this.markersObjects=[],this.defaults={lat:0,long:0,zoom:5,view:"road",scale:!1,enable_info_window:!1,markers:[],map_center:null,markerImage:""},this.ref instanceof HTMLElement)this.initWithDataAttributes();else{if(!(this.ref instanceof Object))return;this.initWithOptions(this.ref)}this.defaultZoom=parseInt(this.options.zoom)||15,this.used_marker_ids=[],this.scale=this.options.scale||null,this.scaleControl=null}}var e=t.prototype;return e.initWithDataAttributes=function(){this.wrapper=this.ref,this.map_element=this.wrapper.querySelector(".map-item"),this.initWithOptions(JSON.parse(this.wrapper.dataset.options))},e.initWithOptions=function(t){void 0===t&&(t={}),this.options=Object.assign({},this.defaults,t);var e=this.options.value.split(",");this.options.lat=parseFloat(e[0])||this.options.lat,this.options.long=parseFloat(e[1])||this.options.long,this.wrapper||(this.wrapper=document.querySelector(".nrf-widget.openstreetmap#"+this.options.id)),this.map_element||(this.map_element=this.wrapper.querySelector(".map-item"))},e.render=function(){var i=this;(this.map=L.map(this.map_element,{gestureHandling:!0,gestureHandlingOptions:{text:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"}},contextmenu:!0,contextmenuWidth:140,contextmenuItems:[{text:window.parent.Joomla.Text._("NR_ADD_MARKER"),callback:function(t){var e=new CustomEvent("onTFMapContextMenuAddMarker",{detail:{map:i.wrapper,service:"openstreetmap",e:t}});document.dispatchEvent(e)}}]}),this.map.contextmenu&&this.map.contextmenu.disable(),"satellite"===this.options.view)?L.esri.Vector.vectorBasemapLayer("ArcGIS:Imagery",{apiKey:this.options.provider_key}).addTo(this.map):L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',subdomains:["a","b","c"]}).addTo(this.map);this.map.setView([this.options.lat,this.options.long],this.defaultZoom),this.setScale(this.options.scale),this.wrapper.OpenStreetMap=this;var t=new CustomEvent("onTFMapWidgetRender",{detail:{map:this.wrapper,service:"openstreetmap"}});document.dispatchEvent(t)},e.setScale=function(t){if(this.scaleControl&&(this.map.removeControl(this.scaleControl),this.scaleControl=null),t){var e={};"imperial"===t?(e.imperial=!0,e.metric=!1):(e.imperial=!1,e.metric=!0),this.scaleControl=L.control.scale(e).addTo(this.map)}},e.getMarkerContent=function(t){var e=document.createElement("div");e.classList.add("nr-map-map-marker-container");var i=document.createElement("h6");if(i.classList.add("nr-map-map-marker-label"),i.innerHTML=t.label&&""!==t.label?t.label:t.address&&""!==t.address?t.address:"",e.appendChild(i),t.description&&""!==t.description){var s=document.createElement("div");s.classList.add("nr-map-map-marker-content");var r=document.createElement("p");r.innerHTML=t.description.replace(/\n/g,"<br/>"),s.appendChild(r),e.appendChild(s)}return e},e.createMarker=function(t){if(t.id||(t.id=(new Date).getTime()),!this.used_marker_ids.includes(t.id)){var e={id:t.id,draggable:this.markers_draggable};if(""!==this.options.markerImage){var i=new window.L.DivIcon({html:'<img src="'+this.options.markerImage+'" style="max-width: 22px !important;" />'});e.icon=i}var s=window.L.marker([t.latitude,t.longitude],e);this.options.enable_info_window&&(t.label&&""!==t.label||t.description&&""!==t.description||t.address&&""!==t.address)&&s.bindPopup(this.getMarkerContent(t));var r=new CustomEvent("onTFMapMarkerCreate",{detail:{map:this.wrapper,markerMap:s,markerProps:t,service:"openstreetmap"}});return document.dispatchEvent(r),0===this.options.markers.filter(function(t){return t.id===e.id}).length&&this.options.markers.push(t),0===this.markersObjects.filter(function(t){return t.options.id===e.id}).length&&this.markersObjects.push(s),this.used_marker_ids.push(t.id),s}},e.deleteMarker=function(e){this.map.removeLayer(e),this.options.markers=this.options.markers.filter(function(t){return t.id!==e.options.id}),this.markersObjects=this.markersObjects.filter(function(t){return t.options.id!==e.options.id});var t=this.used_marker_ids.indexOf(e.options.id);this.used_marker_ids.splice(t,1)},e.updateMarkers=function(){var r=this;this.options.markers.map(function(t,e){var i=new L.LatLng(t.latitude,t.longitude);for(var s in r.markersObjects)if(r.markersObjects[s].options.id===t.id){r.markersObjects[e].setLatLng(i,{animate:!1}),r.markersObjects[e].closePopup(),r.markersObjects[e].unbindPopup(),(t.label&&""!==t.label||t.description&&""!==t.description||t.address&&""!==t.address)&&r.markersObjects[e].bindPopup(r.getMarkerContent(t));break}})},e.renderMarkers=function(){var s=this;this.options.markers.map(function(t,e){if(!s.used_marker_ids.includes(t.id)){var i=s.createMarker(t);s.map.addLayer(i)}})},e.centerMap=function(){if(0!==this.markersObjects.length){var t=L.featureGroup(this.markersObjects),e=1<this.markersObjects.length?this.map.getBoundsZoom(t.getBounds()):this.defaultZoom;if(this.map.setZoom(e,{animate:!1}),"fitbounds"===this.options.zoom_level)this.map.fitBounds(t.getBounds(),{animate:!1,padding:[1,1]});else{var i=this.options.markers[0].latitude,s=this.options.markers[0].longitude;if(null!==this.options.map_center){var r=this.options.map_center.split(",");2===r.length&&(i=r[0],s=r[1])}this.map.setView([i,s],this.defaultZoom,{animate:!1})}}},e.getMap=function(){return this.map},t}(),NR_OSM_Maps=function(){function t(){this.init()}return t.prototype.init=function(){if(window.IntersectionObserver){var t=document.querySelectorAll(".nrf-widget.openstreetmap:not(.no-map):not(.done)");if(0!==t.length){var e=new IntersectionObserver(function(t,s){t.forEach(function(t){if(t.isIntersecting){t.target.classList.add("done");var e=t.target.hasAttribute("data-options")?JSON.parse(t.target.dataset.options):t.target,i=new NR_OSM_Map(e);i.render(),i.renderMarkers(),i.centerMap(),s.unobserve(t.target)}})},{rootMargin:"0px 0px 0px 0px"});t.forEach(function(t){e.observe(t)})}}},t}();document.addEventListener("DOMContentLoaded",function(){new NR_OSM_Maps});


Anon7 - 2022
AnonSec Team