PageSourceSearch

https://www.carotenoidspalma2026.org/js/widgets/mapsdgio/maps/arcgis/arcgis_mapizer.js

js carotenoidspalma2026.org collected 2026-10-08 18:55:07 UTC 11,198 bytes, 65 lines download raw bytes

1ArcgisMapizer=function(config,mapOptions){this.baseconfig=config;this._class='ArcgisMapizer';this.event_listeners={};return this.init(config.container,mapOptions,config.kml,config.marker);}
2ArcgisMapizer.prototype=new Mapizer();ArcgisMapizer.prototype.init=function(container,config,kml,marker){this.mapconfig=config;this.container=container;this.container_id=$(container).attr('id');this.container_parent=$(container).parents('.map')[0];this.maxZoomLevel=20;this.minZoomLevel=1;this.markers={};this.last_marker_id=0;this.last_marker=null;this.last_maptype=null;this.last_center=null;this.constants.arcgis={'spatialReference':{'geographic':{wkid:4326},'webmercator':{wkid:102100}},'layers':{'base':{'terrain':'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer','road':'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer','satellite':'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer','openstreet':'OPENSTREETMAPS'},'extra':{}}}
3this.layers={};var initialExtent=null;if($.isArray(config.center)&&typeof config.center[1]!='undefined'&&config.center[0]!='undefined'){config.center=new esri.geometry.Point(config.center[1],config.center[0],new esri.SpatialReference(this.constants.arcgis.spatialReference.geographic))}
4if(typeof config.center=='undefined'||typeof config.center.x=='undefined'||typeof config.center.y=='undefined'){config.center={x:0,y:0};}
5var bl=esri.geometry.geographicToWebMercator(new esri.geometry.Point({x:config.center.x,y:config.center.y,spatialReference:this.constants.arcgis.spatialReference.geographic}));var tr=esri.geometry.geographicToWebMercator(new esri.geometry.Point({x:config.center.x,y:config.center.y,spatialReference:this.constants.arcgis.spatialReference.geographic}));initialExtent=new esri.geometry.Extent({xmin:parseFloat(bl.x),ymin:parseFloat(bl.y),xmax:parseFloat(tr.x),ymax:parseFloat(tr.y),spatialReference:this.constants.arcgis.spatialReference.webmercator});if(typeof initialExtent=='undefined'||!initialExtent)
6this.map=new esri.Map(container);else
7this.map=new esri.Map(container,{extent:initialExtent,navigationMode:'css-transforms'});var basemap=new esri.layers.ArcGISTiledMapServiceLayer(this.constants.arcgis.layers.base.road);this.map.addLayer(basemap);var that=this;dojo.connect(this.map,'onLoad',function(evt){that.last_maptype=(typeof config.mapTypeId!='undefined')?config.mapTypeId:'openstreet';that.setMapType(that.last_maptype);that.map.centerAndZoom(esri.geometry.geographicToWebMercator(config.center),parseInt(config.zoom));dojo.connect(that.map,'onResize',function(){if(typeof that.last_center!='undefined'&&that.last_center!=null){that.setCenter(that.last_center);}});that.map.hidePanArrows();that.map.hideZoomSlider();that.map.disableClickRecenter();that.map.disableKeyboardNavigation();that.map.disableShiftDoubleClickZoom();that.map.disableRubberBandZoom();that.map.disableDoubleClickZoom();if(kml){that.KMLLayer=new esri.layers.KMLLayer(kml);that.map.addLayer(that.KMLLayer);}
8if(marker&&typeof marker!='undefined'){var options={};if(typeof marker.position!='undefined'){options.lat=parseFloat(marker.position[0]);options.lng=parseFloat(marker.position[1]);if(marker.text&&typeof marker.text!='undefined')options.text=marker.text;if(marker.title&&typeof marker.title!='undefined')options.title=marker.title;if(marker.icon&&typeof marker.icon!='undefined'){if(marker.icon.length==7){options.icon={'icon':marker.icon[0],'size':{w:parseInt(marker.icon[1]),h:parseInt(marker.icon[2])}};}
9else if(marker.icon.length==1){options.icon=marker.icon[0];}}
10that.addMarker(options);}}});this.container._map=this.map;$(window).resize(function(){if(that.fullscreenActive)that._fullscreenResize();});return this;}
11ArcgisMapizer.prototype.resize=function(){this.last_center=this.getCenter();this.map.resize(true);}
12ArcgisMapizer.prototype.addControls=function(controls){}
13ArcgisMapizer.prototype.removeControls=function(controls){}
14ArcgisMapizer.prototype.show=function(){$(this.container).show();}
15ArcgisMapizer.prototype.hide=function(){$(this.container).hide();}
16ArcgisMapizer.prototype.zoomIn=function(){var zoom=this.map.getLevel();var new_zoom=zoom+1;if(new_zoom>this.maxZoomLevel)new_zoom=this.maxZoomLevel;
16this.map.setLevel(new_zoom);}
17ArcgisMapizer.prototype.zoomOut=function(){var zoom=this.map.getLevel();var new_zoom=zoom-1;if(new_zoom<this.minZoomLevel)new_zoom=this.minZoomLevel;this.map.setLevel(new_zoom);}
18ArcgisMapizer.prototype.setZoom=function(zoom){if(zoom>this.maxZoomLevel)zoom=this.maxZoomLevel;else if(zoom<this.minZoomLevel)zoom=this.minZoomLevel;this.map.setLevel(zoom);}
19ArcgisMapizer.prototype.getZoom=function(){return parseInt(this.map.getLevel());}
20ArcgisMapizer.prototype.setMaxZoom=function(zoom){}
21ArcgisMapizer.prototype.setMinZoom=function(zoom){}
22ArcgisMapizer.prototype.setCenter=function(lat,lng){if(typeof lat=='object'&&typeof lat.lat!='undefined'&&lat.lng!='undefined'){lng=lat.lng;lat=lat.lat;}
23var geographicCenter=esri.geometry.Point({x:parseFloat(lng),y:parseFloat(lat),spatialReference:this.constants.arcgis.spatialReference.geographic});var mercatorCenter=esri.geometry.geographicToWebMercator(geographicCenter);this.map.centerAt(mercatorCenter);}
24ArcgisMapizer.prototype.getCenter=function(){var mapCenter=this.map.extent.getCenter();return this._getLatLng(mapCenter);}
25ArcgisMapizer.prototype.addMarker=function(options){var marker_id=this.last_marker_id;this.last_marker_id++;var position=new esri.geometry.geographicToWebMercator(esri.geometry.Point(parseFloat(options.lng),parseFloat(options.lat),new esri.SpatialReference(this.constants.arcgis.spatialReference.geographic)));if(options.title);if(options.icon&&typeof options.icon=='object'){marker_symbol=new esri.symbol.PictureMarkerSymbol(options.icon.icon,options.icon.size.w,options.icon.size.h);}
26else if(options.icon&&typeof options.icon=='string'){marker_symbol=new esri.symbol.PictureMarkerSymbol(options.icon,32,32);}
27else{marker_symbol=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE,10,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([255,0,0]),1),new dojo.Color([0,255,0,0.25]));}
28var marker=new esri.Graphic(position,marker_symbol);marker._mapizer_id=marker_id;this.markers.marker_id=marker;this.map.graphics.add(marker);var that=this;if(options.text&&typeof options.text!='undefined'){var info=new esri.InfoTemplate();if(options.title)info.setTitle(options.title);info.setContent(options.text);marker.setInfoTemplate(info);}
29this.last_marker=marker;return marker;}
30ArcgisMapizer.prototype.removeMarker=function(marker){}
31ArcgisMapizer.prototype.getMarkerPosition=function(marker){if(typeof marker=='undefined'){if(typeof this.last_marker!='undefined'&&this.last_marker!=null){return this._getLatLng(this.last_marker);}
32else return{lat:'',lng:''};}
33else if(typeof marker=='integer'){if(typeof this.markers.marker!='undefined'){return this._getLatLng(this.markers.marker);}
34else return{lat:'',lng:''};}
35else if(typeof marker=='object'&&marker!=null&&typeof marker.geometry=='object'&&marker.geometry.declaredClass=='Point'){return this._getLatLng(marker);}
36else return{lat:'',lng:''};}
37ArcgisMapizer.prototype.inverseGeocode=function(position){if(typeof position=='object'&&typeof position.lat!='undefined'&&typeof position.lng!='undefined'){return position.lat+','+position.lng;}
38else return'not valid position';}
39ArcgisMapizer.prototype.openInfoWindow=function(message,lat,lng){}
40ArcgisMapizer.prototype.closeInfoWindow=function(){}
41ArcgisMapizer.prototype.setMapType=function(mapType){if(typeof this.constants.arcgis.layers.base[mapType]!='undefined'){if(typeof this.layers[this.last_maptype]!='undefined'){this.layers[this.last_maptype].hide();}
42if(typeof this.layers[mapType]!='undefined'){this.layers[mapType].show();}
43else{var layer=null;switch(mapType){case'openstreet':layer=new esri.layers.OpenStreetMapLayer();break;default:layer=new esri.layers.ArcGISTiledMapServiceLayer(this.constants.arcgis.layers.base[mapType]);break;}
44this._addLayer(layer,mapType);}
45this.last_maptype=mapType;return true;}
46else
47return false;}
48ArcgisMapizer.prototype._addLayer=function(layer,mapType){this.layers[mapType]=layer;this.map.addLayer(this.layers[mapType]);}
49ArcgisMapizer.prototype.getMapType=function(){return this.last_maptype;}
50ArcgisMapizer.prototype.destroy=function(){this.hide();var m=this.baseconfig.mapsdgio;var id=this.baseconfig.container_id;var container=this.container;this.map.removeAllLayers();this.map.destroy();for(var i in this.layers){if(this.layers.hasOwnProperty(i)){this.layers[i]=null;}}
51for(var i in this.markers){if(this.markers.hasOwnProperty(i)){this.markers[i]=null;}}
52setTimeout(function(){delete(mapsdgio.maps[id]);$(container).parents('.map').remove();},100);}
53ArcgisMapizer.prototype.fullScreen=function(){var container_parent=$(this.container).parents('.map')[0];if(this.fullscreenActive){try{if($.browser.msie){$(container_parent).css({'z-index':this._last_container_properties['z-index'],'width':this._last_container_properties['width'],'height':this._last_container_properties['height'],'float':this._last_container_properties['float'],'top':this._last_container_properties['top'],'left':this._last_container_properties['left']});var that=this;if(this._last_container_properties!='absolute'&&this._last_container_properties!='fixed')
54setTimeout(function(){$(container_parent).css({position:'static'});that.resize();},100);}
55else
56$(container_parent).css(this._last_container_properties);this.resize();delete(this._last_container_properties);this.fullscreenActive=false;}catch(e){this.hide();return false;}}
57else{try{this._last_container_properties={'z-index':$(container_parent).css('z-index'),'width':$(container_parent).css('width'),'height':$(container_parent).css('height'),'position':$(container_parent).css('position'),'top':$(container_parent).css('top'),'left':$(container_parent).css('left'),'float':$(container_parent).css('float')}
58$(container_parent).css({'z-index':9999,'width':$(window).width()+'px','height':$(window).height()+'px','position':'fixed','top':'0px','left':'0px'});this.resize();this.fullscreenActive=true;}catch(e){console.log(e);this.hide();return false;}}}
59ArcgisMapizer.prototype._fullscreenResize=function(){var container_parent=$(this.container).parents('.map')[0];try{$(container_parent).css({'z-index':9999,'width':$(window).width()+'px','height':$(window).height()+'px','position':'fixed','top':'0px','left':'0px'});this.resize();}catch(e){console.log(e);this.hide();return false;}
60return true;}
61ArcgisMapizer.prototype._getLatLng=function(item){var latlng=null;if(item.declaredClass=='esri.Graphic'||typeof item.geometry!='undefined'){item=item.geometry;}
62else if(item.type!='point'||typeof item.spatialReference=='undefined'||typeof item.x=='undefined'||item.y=='undefined'){return false;}
63if(item.spatialReference.wkid!=this.constants.arcgis.spatialReference.geographic.wkid){var geographicPosition=esri.geometry.webMercatorToGeographic(item);latlng={lat:parseFloat(geographicPosition.y),lng:parseFloat(geographicPosition.x)};}
64else{latlng={lat:parseFloat(item.y),lng:parseFloat(item.x)}}
65return latlng;}

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.