summaryrefslogtreecommitdiff
path: root/site/media/js/photos.min.js
blob: c0fbfdf5241fefdb3314d27da976103f34b1b45c (plain)
1
b'(function () {\n\t\'use strict\';\n\n\tL.TileLayer.Provider = L.TileLayer.extend({\n\t\tinitialize: function (arg, options) {\n\t\t\tvar providers = L.TileLayer.Provider.providers;\n\n\t\t\tvar parts = arg.split(\'.\');\n\n\t\t\tvar providerName = parts[0];\n\t\t\tvar variantName = parts[1];\n\n\t\t\tif (!providers[providerName]) {\n\t\t\t\tthrow \'No such provider (\' + providerName + \')\';\n\t\t\t}\n\n\t\t\tvar provider = {\n\t\t\t\turl: providers[providerName].url,\n\t\t\t\toptions: providers[providerName].options\n\t\t\t};\n\n\t\t\t// overwrite values in provider from variant.\n\t\t\tif (variantName && \'variants\' in providers[providerName]) {\n\t\t\t\tif (!(variantName in providers[providerName].variants)) {\n\t\t\t\t\tthrow \'No such variant of \' + providerName + \' (\' + variantName + \')\';\n\t\t\t\t}\n\t\t\t\tvar variant = providers[providerName].variants[variantName];\n\t\t\t\tvar variantOptions;\n\t\t\t\tif (typeof variant === \'string\') {\n\t\t\t\t\tvariantOptions = {\n\t\t\t\t\t\tvariant: variant\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tvariantOptions = variant.options;\n\t\t\t\t}\n\t\t\t\tprovider = {\n\t\t\t\t\turl: variant.url || provider.url,\n\t\t\t\t\toptions: L.Util.extend({}, provider.options, variantOptions)\n\t\t\t\t};\n\t\t\t} else if (typeof provider.url === \'function\') {\n\t\t\t\tprovider.url = provider.url(parts.splice(1, parts.length - 1).join(\'.\'));\n\t\t\t}\n\n\t\t\t// replace attribution placeholders with their values from toplevel provider attribution,\n\t\t\t// recursively\n\t\t\tvar attributionReplacer = function (attr) {\n\t\t\t\tif (attr.indexOf(\'{attribution.\') === -1) {\n\t\t\t\t\treturn attr;\n\t\t\t\t}\n\t\t\t\treturn attr.replace(/\\{attribution.(\\w*)\\}/,\n\t\t\t\t\tfunction (match, attributionName) {\n\t\t\t\t\t\treturn attributionReplacer(providers[attributionName].options.attribution);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tprovider.options.attribution = attributionReplacer(provider.options.attribution);\n\n\t\t\t// Compute final options combining provider options with any user overrides\n\t\t\tvar layerOpts = L.Util.extend({}, provider.options, options);\n\t\t\tL.TileLayer.prototype.initialize.call(this, provider.url, layerOpts);\n\t\t}\n\t});\n\n\t/**\n\t * Definition of providers.\n\t * see http://leafletjs.com/reference.html#tilelayer for options in the options map.\n\t */\n\n\t//jshint maxlen:220\n\tL.TileLayer.Provider.providers = {\n\t\tOpenStreetMap: {\n\t\t\turl: \'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, \' +\n\t\t\t\t\t\'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tMapnik: {},\n\t\t\t\tBlackAndWhite: {\n\t\t\t\t\turl: \'http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png\'\n\t\t\t\t},\n\t\t\t\tDE: {\n\t\t\t\t\turl: \'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png\'\n\t\t\t\t},\n\t\t\t\tHOT: {\n\t\t\t\t\turl: \'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png\',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tattribution: \'{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>\'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tOpenSeaMap: {\n\t\t\turl: \'http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution: \'Map data: &copy; <a href="http://www.openseamap.org">OpenSeaMap</a> contributors\'\n\t\t\t}\n\t\t},\n\t\tThunderforest: {\n\t\t\turl: \'http://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'&copy; <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}\',\n\t\t\t\tvariant: \'cycle\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tOpenCycleMap: \'cycle\',\n\t\t\t\tTransport: \'transport\',\n\t\t\t\tLandscape: \'landscape\',\n\t\t\t\tOutdoors: \'outdoors\'\n\t\t\t}\n\t\t},\n\t\tOpenMapSurfer: {\n\t\t\turl: \'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}\',\n\t\t\toptions: {\n\t\t\t\tminZoom: 0,\n\t\t\t\tmaxZoom: 20,\n\t\t\t\tvariant: \'roads\',\n\t\t\t\tattribution: \'Imagery from <a href="http://giscience.uni-hd.de/">GIScience Research Group @ University of Heidelberg</a> &mdash; Map data {attribution.OpenStreetMap}\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tRoads: \'roads\',\n\t\t\t\tAdminBounds: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'adminb\',\n\t\t\t\t\t\tmaxZoom: 19\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tGrayscale: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'roadsg\',\n\t\t\t\t\t\tmaxZoom: 19\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tMapQuestOpen: {\n\t\t\turl: \'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; \' +\n\t\t\t\t\t\'Map data {attribution.OpenStreetMap}\',\n\t\t\t\tsubdomains: \'1234\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tOSM: {},\n\t\t\t\tAerial: {\n\t\t\t\t\turl: \'http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg\',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tattribution:\n\t\t\t\t\t\t\t\'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; \' +\n\t\t\t\t\t\t\t\'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency\'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tMapBox: {\n\t\t\turl: function (id) {\n\t\t\t\treturn \'http://{s}.tiles.mapbox.com/v3/\' + id + \'/{z}/{x}/{y}.png\';\n\t\t\t},\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> &mdash; \' +\n\t\t\t\t\t\'Map data {attribution.OpenStreetMap}\',\n\t\t\t\tsubdomains: \'abcd\'\n\t\t\t}\n\t\t},\n\t\tStamen: {\n\t\t\turl: \'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'Map tiles by <a href="http://stamen.com">Stamen Design</a>, \' +\n\t\t\t\t\t\'<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> &mdash; \' +\n\t\t\t\t\t\'Map data {attribution.OpenStreetMap}\',\n\t\t\t\tsubdomains: \'abcd\',\n\t\t\t\tminZoom: 0,\n\t\t\t\tmaxZoom: 20,\n\t\t\t\tvariant: \'toner\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tToner: \'toner\',\n\t\t\t\tTonerBackground: \'toner-background\',\n\t\t\t\tTonerHybrid: \'toner-hybrid\',\n\t\t\t\tTonerLines: \'toner-lines\',\n\t\t\t\tTonerLabels: \'toner-labels\',\n\t\t\t\tTonerLite: \'toner-lite\',\n\t\t\t\tTerrain: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'terrain\',\n\t\t\t\t\t\tminZoom: 4,\n\t\t\t\t\t\tmaxZoom: 18\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tTerrainBackground: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'terrain-background\',\n\t\t\t\t\t\tminZoom: 4,\n\t\t\t\t\t\tmaxZoom: 18\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWatercolor: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'watercolor\',\n\t\t\t\t\t\tminZoom: 3,\n\t\t\t\t\t\tmaxZoom: 16\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tEsri: {\n\t\t\turl: \'https://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}\',\n\t\t\toptions: {\n\t\t\t\tvariant: \'World_Street_Map\',\n\t\t\t\tattribution: \'Tiles &copy; Esri\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tWorldStreetMap: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tattribution:\n\t\t\t\t\t\t\t\'{attribution.Esri} &mdash; \' +\n\t\t\t\t\t\t\t\'Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tDeLorme: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'Specialty/DeLorme_World_Base_Map\',\n\t\t\t\t\t\tminZoom: 1,\n\t\t\t\t\t\tmaxZoom: 11,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; Copyright: &copy;2012 DeLorme\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldTopoMap: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'World_Topo_Map\',\n\t\t\t\t\t\tattribution:\n\t\t\t\t\t\t\t\'{attribution.Esri} &mdash; \' +\n\t\t\t\t\t\t\t\'Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldImagery: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'World_Imagery\',\n\t\t\t\t\t\tattribution:\n\t\t\t\t\t\t\t\'{attribution.Esri} &mdash; \' +\n\t\t\t\t\t\t\t\'Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldTerrain: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'World_Terrain_Base\',\n\t\t\t\t\t\tmaxZoom: 13,\n\t\t\t\t\t\tattribution:\n\t\t\t\t\t\t\t\'{attribution.Esri} &mdash; \' +\n\t\t\t\t\t\t\t\'Source: USGS, Esri, TANA, DeLorme, and NPS\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldShadedRelief: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'World_Shaded_Relief\',\n\t\t\t\t\t\tmaxZoom: 13,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; Source: Esri\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldPhysical: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'World_Physical_Map\',\n\t\t\t\t\t\tmaxZoom: 8,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; Source: US National Park Service\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tOceanBasemap: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'Ocean_Basemap\',\n\t\t\t\t\t\tmaxZoom: 13,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tNatGeoWorldMap: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'NatGeo_World_Map\',\n\t\t\t\t\t\tmaxZoom: 16,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tWorldGrayCanvas: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tvariant: \'Canvas/World_Light_Gray_Base\',\n\t\t\t\t\t\tmaxZoom: 16,\n\t\t\t\t\t\tattribution: \'{attribution.Esri} &mdash; Esri, DeLorme, NAVTEQ\'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tOpenWeatherMap: {\n\t\t\turl: \'http://{s}.tile.openweathermap.org/map/{variant}/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution: \'Map data &copy; <a href="http://openweathermap.org">OpenWeatherMap</a>\',\n\t\t\t\topacity: 0.5\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tClouds: \'clouds\',\n\t\t\t\tCloudsClassic: \'clouds_cls\',\n\t\t\t\tPrecipitation: \'precipitation\',\n\t\t\t\tPrecipitationClassic: \'precipitation_cls\',\n\t\t\t\tRain: \'rain\',\n\t\t\t\tRainClassic: \'rain_cls\',\n\t\t\t\tPressure: \'pressure\',\n\t\t\t\tPressureContour: \'pressure_cntr\',\n\t\t\t\tWind: \'wind\',\n\t\t\t\tTemperature: \'temp\',\n\t\t\t\tSnow: \'snow\'\n\t\t\t}\n\t\t},\n\t\tHERE: {\n\t\t\t/*\n\t\t\t * HERE maps, formerly Nokia maps.\n\t\t\t * These basemaps are free, but you need an API key. Please sign up at\n\t\t\t * http://developer.here.com/getting-started\n\t\t\t *\n\t\t\t * Note that the base urls contain \'.cit\' whichs is HERE\'s\n\t\t\t * \'Customer Integration Testing\' environment. Please remove for production\n\t\t\t * envirionments.\n\t\t\t */\n\t\t\turl:\n\t\t\t\t\'http://{s}.{base}.maps.cit.api.here.com/maptile/2.1/\' +\n\t\t\t\t\'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?\' +\n\t\t\t\t\'app_id={app_id}&app_code={app_code}\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'Map &copy; 1987-2014 <a href="http://developer.here.com">HERE</a>\',\n\t\t\t\tsubdomains: \'1234\',\n\t\t\t\tmapID: \'newest\',\n\t\t\t\t\'app_id\': \'<insert your app_id here>\',\n\t\t\t\t\'app_code\': \'<insert your app_code here>\',\n\t\t\t\tbase: \'base\',\n\t\t\t\tvariant: \'normal.day\',\n\t\t\t\tminZoom: 0,\n\t\t\t\tmaxZoom: 20\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tnormalDay: \'normal.day\',\n\t\t\t\tnormalDayCustom: \'normal.day.custom\',\n\t\t\t\tnormalDayGrey: \'normal.day.grey\',\n\t\t\t\tnormalDayMobile: \'normal.day.mobile\',\n\t\t\t\tnormalDayGreyMobile: \'normal.day.grey.mobile\',\n\t\t\t\tnormalDayTransit: \'normal.day.transit\',\n\t\t\t\tnormalDayTransitMobile: \'normal.day.transit.mobile\',\n\t\t\t\tnormalNight: \'normal.night\',\n\t\t\t\tnormalNightMobile: \'normal.night.mobile\',\n\t\t\t\tnormalNightGrey: \'normal.night.grey\',\n\t\t\t\tnormalNightGreyMobile: \'normal.night.grey.mobile\',\n\n\t\t\t\tcarnavDayGrey: \'carnav.day.grey\',\n\t\t\t\thybridDay: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tbase: \'aerial\',\n\t\t\t\t\t\tvariant: \'hybrid.day\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\thybridDayMobile: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tbase: \'aerial\',\n\t\t\t\t\t\tvariant: \'hybrid.day.mobile\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tpedestrianDay: \'pedestrian.day\',\n\t\t\t\tpedestrianNight: \'pedestrian.night\',\n\t\t\t\tsatelliteDay: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tbase: \'aerial\',\n\t\t\t\t\t\tvariant: \'satellite.day\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tterrainDay: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tbase: \'aerial\',\n\t\t\t\t\t\tvariant: \'terrain.day\'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tterrainDayMobile: {\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tbase: \'aerial\',\n\t\t\t\t\t\tvariant: \'terrain.day.mobile\'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tAcetate: {\n\t\t\turl: \'http://a{s}.acetate.geoiq.com/tiles/{variant}/{z}/{x}/{y}.png\',\n\t\t\toptions: {\n\t\t\t\tattribution:\n\t\t\t\t\t\'&copy;2012 Esri & Stamen, Data from OSM and Natural Earth\',\n\t\t\t\tsubdomains: \'0123\',\n\t\t\t\tminZoom: 2,\n\t\t\t\tmaxZoom: 18,\n\t\t\t\tvariant: \'acetate-base\'\n\t\t\t},\n\t\t\tvariants: {\n\t\t\t\tbasemap: \'acetate-base\',\n\t\t\t\tterrain: \'terrain\',\n\t\t\t\tall: \'acetate-hillshading\',\n\t\t\t\tforeground: \'acetate-fg\',\n\t\t\t\troads: \'acetate-roads\',\n\t\t\t\tlabels: \'acetate-labels\',\n\t\t\t\thillshading: \'hillshading\'\n\t\t\t}\n\t\t}\n\t};\n\n\tL.tileLayer.provider = function (provider, options) {\n\t\treturn new L.TileLayer.Provider(provider, options);\n\t};\n\n\tL.Control.Layers.Provided = L.Control.Layers.extend({\n\t\tinitialize: function (base, overlay, options) {\n\t\t\tvar first;\n\n\t\t\tvar labelFormatter = function (label) {\n\t\t\t\treturn label.replace(/\\./g, \': \').replace(/([a-z])([A-Z])/g, \'$1 $2\');\n\t\t\t};\n\n\t\t\tif (base.length) {\n\t\t\t\t(function () {\n\t\t\t\t\tvar out = {},\n\t\t\t\t\t    len = base.length,\n\t\t\t\t\t    i = 0;\n\n\t\t\t\t\twhile (i < len) {\n\t\t\t\t\t\tif (typeof base[i] === \'string\') {\n\t\t\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\t\t\tfirst = L.tileLayer.provider(base[0]);\n\t\t\t\t\t\t\t\tout[labelFormatter(base[i])] = first;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tout[labelFormatter(base[i])] = L.tileLayer.provider(base[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\tbase = out;\n\t\t\t\t}());\n\t\t\t\tthis._first = first;\n\t\t\t}\n\n\t\t\tif (overlay && overlay.length) {\n\t\t\t\t(function () {\n\t\t\t\t\tvar out = {},\n\t\t\t\t\t    len = overlay.length,\n\t\t\t\t\t    i = 0;\n\n\t\t\t\t\twhile (i < len) {\n\t\t\t\t\t\tif (typeof overlay[i] === \'string\') {\n\t\t\t\t\t\t\tout[labelFormatter(overlay[i])] = L.tileLayer.provider(overlay[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\toverlay = out;\n\t\t\t\t}());\n\t\t\t}\n\t\t\tL.Control.Layers.prototype.initialize.call(this, base, overlay, options);\n\t\t},\n\t\tonAdd: function (map) {\n\t\t\tthis._first.addTo(map);\n\t\t\treturn L.Control.Layers.prototype.onAdd.call(this, map);\n\t\t}\n\t});\n\n\tL.control.layers.provided = function (baseLayers, overlays, options) {\n\t\treturn new L.Control.Layers.Provided(baseLayers, overlays, options);\n\t};\n}());\n\n//Utility functions for map info window\nfunction mapit(obj) {\n    lat = parseFloat(obj.attr(\'data-latitude\'));\n    lon = parseFloat(obj.attr(\'data-longitude\'));\n    elid= obj.attr(\'data-imgid\');\n    map = L.map(document.getElementById("mw-"+elid));\n    centerCoord = new L.LatLng(lat, lon);\n    zoom = 8;\n    L.tileLayer.provider(\'Esri.WorldTopoMap\', {maxZoom: 18, attribution: \'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Tiles &copy; Esri and the GIS User Community\'}).addTo(map);\n    map.setView(centerCoord, zoom);\n    L.marker([lat, lon]).addTo(map);\n}\n    //########## utility functions to create/remove map container ############\nfunction create_map(obj) {\n    //find id of this image caption:\n    var imgid = obj.attr(\'data-imgid\');\n    //create container divs\n    $(\'<div class="map-container" id="mc-\'+imgid+\'">\').insertBefore($(obj).parent().parent());\n    //$(obj).parent().parent().parent().prepend(\'<div class="map-container" id="mc-\'+imgid+\'">\');\n    $(\'#mc-\'+imgid).append(\'<div class="map-wrapper" id="mw-\'+imgid+\'">\');\n    //deal with the variable height of div.legend\n    $(\'#mc-\'+imgid).css({\n        bottom: function(index, value) {\n        return parseFloat($(obj).parent().parent().height())+20;\n     }\n    });\n    \n    mapit(obj);\n}\nfunction remove_map(imgid) {\n    $(\'#mc-\'+imgid).remove();\n}\n\n//############ Document.ready events ##############\n$(document).ready(function(){ \n\n    //set up click events for map button\n    $(\'.map-link\').click( function() {\n        imgid = $(this).attr(\'data-imgid\');\n        if ($(\'#mc-\'+imgid).is(":visible")) {\n            remove_map(imgid);  \n        } else {\n            create_map($(this));\n        }\n        return false;\n    \n    });\n    var $ele = $(\'#slides\').children();\n    var $curr = 0;\n\t$(document).bind(\'keydown\', function (e) {\n        var code = e.which;\n        switch (code) {\n            case 39:\n                if ($curr <= $ele.size()) {\n                    $.scrollTo($ele[$curr], 800 );\n                    $curr++;\n                }\n                break;\n            case 37:\n                if ($curr > 0) {\n                    $curr--;\n                    var $now = $curr;\n                    $now--;\n                    $.scrollTo($ele[$now], 800 );\n                }\n                break;\n        }\n        return;\n    });\n});\n\n'