geoblacklight 4.4.2 → 5.0.0.pre.alpha.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (577) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build-demo-app.yml +153 -0
  3. data/.github/workflows/prune-containers.yml +19 -0
  4. data/.github/workflows/ruby.yml +54 -52
  5. data/.gitignore +2 -2
  6. data/CONTRIBUTING.md +62 -44
  7. data/Gemfile +3 -28
  8. data/Rakefile +42 -67
  9. data/app/assets/images/blacklight/logo.svg +31 -1
  10. data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +1 -2
  11. data/app/assets/stylesheets/geoblacklight/modules/_base.scss +1 -1
  12. data/app/assets/stylesheets/geoblacklight/modules/_blacklight_overrides.scss +24 -26
  13. data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +13 -0
  14. data/app/assets/stylesheets/geoblacklight/modules/home.scss +2 -17
  15. data/app/assets/stylesheets/geoblacklight/modules/icon-customization.scss +48 -23
  16. data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +1 -15
  17. data/app/assets/stylesheets/geoblacklight/modules/item.scss +13 -11
  18. data/app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss +3 -3
  19. data/app/assets/stylesheets/geoblacklight/modules/leaflet.scss +4 -0
  20. data/app/assets/stylesheets/geoblacklight/modules/modal.scss +0 -15
  21. data/app/assets/stylesheets/geoblacklight/modules/results.scss +10 -19
  22. data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +2 -2
  23. data/app/components/blacklight/icons/american_geographical_society_library_uwm_libraries_component.rb +46 -0
  24. data/app/components/blacklight/icons/arizona_component.rb +24 -0
  25. data/app/components/blacklight/icons/arrow_circle_down_component.rb +23 -0
  26. data/app/components/blacklight/icons/baruch_cuny_component.rb +23 -0
  27. data/app/components/blacklight/icons/book_component.rb +23 -0
  28. data/app/components/blacklight/icons/bookmark_component.rb +23 -0
  29. data/app/components/blacklight/icons/cd_rom_component.rb +23 -0
  30. data/app/components/blacklight/icons/child_item_component.rb +23 -0
  31. data/app/components/blacklight/icons/circle_info_solid_component.rb +23 -0
  32. data/app/components/blacklight/icons/citation_component.rb +23 -0
  33. data/app/components/blacklight/icons/collection_component.rb +23 -0
  34. data/app/components/blacklight/icons/collections_component.rb +24 -0
  35. data/app/components/blacklight/icons/columbia_component.rb +23 -0
  36. data/app/components/blacklight/icons/cornell_component.rb +25 -0
  37. data/app/components/blacklight/icons/datasets_component.rb +27 -0
  38. data/app/components/blacklight/icons/dvd_rom_component.rb +23 -0
  39. data/app/components/blacklight/icons/email_component.rb +23 -0
  40. data/app/components/blacklight/icons/esri_globe_component.rb +51 -0
  41. data/app/components/blacklight/icons/fire_solid_component.rb +23 -0
  42. data/app/components/blacklight/icons/george_mason_component.rb +24 -0
  43. data/app/components/blacklight/icons/globe_component.rb +23 -0
  44. data/app/components/blacklight/icons/harvard_component.rb +23 -0
  45. data/app/components/blacklight/icons/home_component.rb +23 -0
  46. data/app/components/blacklight/icons/iiif_drag_drop_component.rb +31 -0
  47. data/app/components/blacklight/icons/image_component.rb +23 -0
  48. data/app/components/blacklight/icons/imagery_component.rb +24 -0
  49. data/app/components/blacklight/icons/indiana_component.rb +23 -0
  50. data/app/components/blacklight/icons/leaf_component.rb +23 -0
  51. data/app/components/blacklight/icons/lewis_clark_component.rb +25 -0
  52. data/app/components/blacklight/icons/lightbulb_solid_component.rb +23 -0
  53. data/app/components/blacklight/icons/line_component.rb +24 -0
  54. data/app/components/blacklight/icons/map_component.rb +23 -0
  55. data/app/components/blacklight/icons/map_marker_component.rb +23 -0
  56. data/app/components/blacklight/icons/maps_component.rb +24 -0
  57. data/app/components/blacklight/icons/massgis_component.rb +23 -0
  58. data/app/components/blacklight/icons/metadata_component.rb +23 -0
  59. data/app/components/blacklight/icons/michigan_state_university_component.rb +25 -0
  60. data/app/components/blacklight/icons/mit_component.rb +23 -0
  61. data/app/components/blacklight/icons/mixed_component.rb +25 -0
  62. data/app/components/blacklight/icons/multilinestring_component.rb +26 -0
  63. data/app/components/blacklight/icons/multipoint_component.rb +23 -0
  64. data/app/components/blacklight/icons/multipolygon_component.rb +26 -0
  65. data/app/components/blacklight/icons/northwestern_university_component.rb +24 -0
  66. data/app/components/blacklight/icons/nyu_component.rb +26 -0
  67. data/app/components/blacklight/icons/pagelines_brands_component.rb +23 -0
  68. data/app/components/blacklight/icons/paper_map_component.rb +23 -0
  69. data/app/components/blacklight/icons/parent_item_component.rb +23 -0
  70. data/app/components/blacklight/icons/pennsylvania_state_university_component.rb +25 -0
  71. data/app/components/blacklight/icons/point_component.rb +23 -0
  72. data/app/components/blacklight/icons/polygon_component.rb +24 -0
  73. data/app/components/blacklight/icons/polyline_component.rb +26 -0
  74. data/app/components/blacklight/icons/princeton_component.rb +23 -0
  75. data/app/components/blacklight/icons/public_component.rb +23 -0
  76. data/app/components/blacklight/icons/purdue_university_component.rb +25 -0
  77. data/app/components/blacklight/icons/raster_component.rb +23 -0
  78. data/app/components/blacklight/icons/restricted_component.rb +23 -0
  79. data/app/components/blacklight/icons/rutgers_component.rb +25 -0
  80. data/app/components/blacklight/icons/sms_component.rb +23 -0
  81. data/app/components/blacklight/icons/stanford_component.rb +23 -0
  82. data/app/components/blacklight/icons/table_component.rb +23 -0
  83. data/app/components/blacklight/icons/tags_component.rb +23 -0
  84. data/app/components/blacklight/icons/texas_component.rb +23 -0
  85. data/app/components/blacklight/icons/the_ohio_state_university_component.rb +26 -0
  86. data/app/components/blacklight/icons/triangle_exclamation_solid_component.rb +23 -0
  87. data/app/components/blacklight/icons/tufts_component.rb +23 -0
  88. data/app/components/blacklight/icons/ucla_component.rb +23 -0
  89. data/app/components/blacklight/icons/university_of_california_berkeley_component.rb +24 -0
  90. data/app/components/blacklight/icons/university_of_chicago_component.rb +25 -0
  91. data/app/components/blacklight/icons/university_of_colorado_boulder_component.rb +26 -0
  92. data/app/components/blacklight/icons/university_of_illinois_urbana_champaign_component.rb +25 -0
  93. data/app/components/blacklight/icons/university_of_iowa_component.rb +24 -0
  94. data/app/components/blacklight/icons/university_of_maryland_component.rb +24 -0
  95. data/app/components/blacklight/icons/university_of_michigan_component.rb +24 -0
  96. data/app/components/blacklight/icons/university_of_minnesota_component.rb +24 -0
  97. data/app/components/blacklight/icons/university_of_nebraska_lincoln_component.rb +27 -0
  98. data/app/components/blacklight/icons/university_of_wisconsin_madison_component.rb +24 -0
  99. data/app/components/blacklight/icons/uva_component.rb +23 -0
  100. data/app/components/blacklight/icons/web_services_component.rb +23 -0
  101. data/app/components/blacklight/icons/websites_component.rb +24 -0
  102. data/app/components/geoblacklight/arcgis_component.html.erb +3 -0
  103. data/app/components/geoblacklight/arcgis_component.rb +25 -0
  104. data/app/components/geoblacklight/attribute_table_component.html.erb +17 -0
  105. data/app/components/geoblacklight/attribute_table_component.rb +17 -0
  106. data/app/components/geoblacklight/data_dictionary_download_component.html.erb +3 -0
  107. data/app/components/geoblacklight/data_dictionary_download_component.rb +16 -0
  108. data/app/components/geoblacklight/display_note_component.rb +1 -1
  109. data/app/components/geoblacklight/document/citation_component.html.erb +1 -0
  110. data/app/components/geoblacklight/document/citation_component.rb +19 -0
  111. data/app/components/geoblacklight/document/sidebar_component.html.erb +12 -0
  112. data/app/components/geoblacklight/document/sidebar_component.rb +8 -0
  113. data/app/components/geoblacklight/document_component.html.erb +43 -0
  114. data/app/components/geoblacklight/document_component.rb +6 -0
  115. data/app/components/geoblacklight/download_links_component.html.erb +31 -0
  116. data/app/components/geoblacklight/download_links_component.rb +80 -0
  117. data/app/components/geoblacklight/header_component.html.erb +14 -0
  118. data/app/components/geoblacklight/header_component.rb +9 -0
  119. data/app/components/geoblacklight/header_icons_component.html.erb +3 -0
  120. data/app/components/geoblacklight/header_icons_component.rb +29 -0
  121. data/app/components/geoblacklight/iiif_drag_drop_component.html.erb +3 -0
  122. data/app/components/geoblacklight/iiif_drag_drop_component.rb +16 -0
  123. data/app/components/geoblacklight/index_map_inspect_component.rb +15 -0
  124. data/app/components/geoblacklight/index_map_legend_component.html.erb +14 -0
  125. data/app/components/geoblacklight/index_map_legend_component.rb +17 -0
  126. data/app/components/geoblacklight/item_map_viewer_component.html.erb +1 -0
  127. data/app/components/geoblacklight/item_map_viewer_component.rb +87 -0
  128. data/app/components/geoblacklight/location_leaflet_map_component.html.erb +1 -0
  129. data/app/components/geoblacklight/location_leaflet_map_component.rb +49 -0
  130. data/app/components/geoblacklight/login_link_component.html.erb +5 -0
  131. data/app/components/geoblacklight/login_link_component.rb +17 -0
  132. data/app/components/geoblacklight/relations_component.html.erb +23 -0
  133. data/app/components/geoblacklight/relations_component.rb +25 -0
  134. data/app/components/geoblacklight/search_result_component.html.erb +44 -0
  135. data/app/{presenters/geoblacklight/document_presenter.rb → components/geoblacklight/search_result_component.rb} +9 -6
  136. data/app/components/geoblacklight/static_map_component.html.erb +9 -0
  137. data/app/components/geoblacklight/static_map_component.rb +36 -0
  138. data/app/components/geoblacklight/viewer_help_text_component.html.erb +1 -0
  139. data/app/components/geoblacklight/viewer_help_text_component.rb +46 -0
  140. data/app/components/geoblacklight/web_services_component.html.erb +1 -0
  141. data/app/components/geoblacklight/web_services_component.rb +26 -0
  142. data/app/{views/catalog/_web_services_default.html.erb → components/geoblacklight/web_services_default_component.html.erb} +3 -5
  143. data/app/components/geoblacklight/web_services_default_component.rb +11 -0
  144. data/app/components/geoblacklight/web_services_link_component.html.erb +3 -0
  145. data/app/components/geoblacklight/web_services_link_component.rb +22 -0
  146. data/app/{views/catalog/_web_services_wfs.html.erb → components/geoblacklight/web_services_wfs_component.html.erb} +4 -7
  147. data/app/components/geoblacklight/web_services_wfs_component.rb +12 -0
  148. data/app/components/geoblacklight/web_services_wms_component.html.erb +10 -0
  149. data/app/components/geoblacklight/web_services_wms_component.rb +12 -0
  150. data/app/controllers/download_controller.rb +8 -24
  151. data/app/helpers/geoblacklight_helper.rb +10 -194
  152. data/app/javascript/geoblacklight/controllers/clipboard_controller.js +11 -0
  153. data/app/javascript/geoblacklight/controllers/clover_viewer_controller.js +47 -0
  154. data/app/javascript/geoblacklight/controllers/downloads_controller.js +56 -0
  155. data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +217 -0
  156. data/app/javascript/geoblacklight/controllers/oembed_viewer_controller.js +18 -0
  157. data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +63 -0
  158. data/app/javascript/geoblacklight/controllers/search_results_controller.js +50 -0
  159. data/app/javascript/geoblacklight/core.js +69 -0
  160. data/app/javascript/geoblacklight/index.js +29 -0
  161. data/app/javascript/geoblacklight/initializers/metadata_download.js +54 -0
  162. data/app/javascript/geoblacklight/initializers/popovers.js +11 -0
  163. data/app/javascript/geoblacklight/initializers/relations.js +40 -0
  164. data/app/javascript/geoblacklight/initializers/tooltips.js +55 -0
  165. data/app/javascript/geoblacklight/initializers/truncation.js +45 -0
  166. data/app/javascript/geoblacklight/leaflet/basemaps.js +74 -0
  167. data/app/javascript/geoblacklight/leaflet/constants.js +18 -0
  168. data/app/javascript/geoblacklight/leaflet/controls/geosearch.js +160 -0
  169. data/app/javascript/geoblacklight/leaflet/controls/layer_opacity.js +120 -0
  170. data/app/javascript/geoblacklight/leaflet/inspection.js +195 -0
  171. data/app/javascript/geoblacklight/leaflet/layer_index_map.js +120 -0
  172. data/app/javascript/geoblacklight/leaflet/layer_wmts.js +59 -0
  173. data/app/javascript/geoblacklight/leaflet/layers.js +153 -0
  174. data/app/javascript/geoblacklight/leaflet/utils.js +83 -0
  175. data/app/javascript/geoblacklight/openlayers/basemaps.js +47 -0
  176. data/app/javascript/geoblacklight/openlayers/layers.js +44 -0
  177. data/app/models/concerns/geoblacklight/solr_document/citation.rb +20 -8
  178. data/app/models/concerns/geoblacklight/solr_document.rb +22 -30
  179. data/app/presenters/geoblacklight/bbox_item_presenter.rb +1 -1
  180. data/app/views/catalog/_citation.html.erb +16 -33
  181. data/app/views/catalog/_document_split.html.erb +18 -3
  182. data/app/views/catalog/_home_text.html.erb +2 -2
  183. data/app/views/catalog/_metadata.html.erb +1 -1
  184. data/app/views/catalog/index.html.erb +8 -4
  185. data/app/views/catalog/metadata/_markup.html.erb +1 -1
  186. data/app/views/catalog/metadata.html.erb +14 -13
  187. data/app/views/catalog/web_services.html.erb +19 -28
  188. data/app/views/relation/index.html.erb +2 -12
  189. data/app/views/relation/index.json.jbuilder +1 -1
  190. data/compose.yml +14 -0
  191. data/config/importmap.rb +20 -0
  192. data/config/locales/geoblacklight.en.yml +15 -24
  193. data/geoblacklight.gemspec +7 -7
  194. data/lib/generators/geoblacklight/assets/importmap_generator.rb +87 -0
  195. data/lib/generators/geoblacklight/assets/vite_generator.rb +90 -0
  196. data/lib/generators/geoblacklight/assets_generator.rb +12 -37
  197. data/lib/generators/geoblacklight/install_generator.rb +11 -49
  198. data/lib/generators/geoblacklight/templates/assets/_customizations.scss +13 -19
  199. data/lib/generators/geoblacklight/templates/assets/application.js +17 -0
  200. data/lib/generators/geoblacklight/templates/assets/application.scss +9 -4
  201. data/lib/generators/geoblacklight/templates/assets/geoblacklight.scss +11 -0
  202. data/lib/generators/geoblacklight/templates/base.html.erb +9 -12
  203. data/lib/generators/geoblacklight/templates/catalog_controller.rb +7 -15
  204. data/lib/generators/geoblacklight/templates/demo-app/Dockerfile +31 -0
  205. data/lib/generators/geoblacklight/templates/demo-app/compose.yml +26 -0
  206. data/lib/generators/geoblacklight/templates/demo-app/start-server.sh +21 -0
  207. data/lib/generators/geoblacklight/templates/package.json +7 -1
  208. data/lib/generators/geoblacklight/templates/settings.yml +45 -40
  209. data/lib/generators/geoblacklight/templates/vite.config.ts +22 -7
  210. data/lib/geoblacklight/bounding_box.rb +16 -0
  211. data/lib/geoblacklight/constants.rb +0 -1
  212. data/lib/geoblacklight/download/csv_download.rb +22 -0
  213. data/lib/geoblacklight/download/geojson_download.rb +1 -1
  214. data/lib/geoblacklight/download/geotiff_download.rb +1 -1
  215. data/lib/geoblacklight/download/kmz_download.rb +1 -1
  216. data/lib/geoblacklight/download/shapefile_download.rb +1 -1
  217. data/lib/geoblacklight/download.rb +1 -1
  218. data/lib/geoblacklight/engine.rb +15 -6
  219. data/lib/geoblacklight/item_viewer.rb +1 -1
  220. data/lib/geoblacklight/metadata/base.rb +2 -1
  221. data/lib/geoblacklight/references.rb +27 -8
  222. data/lib/geoblacklight/routes/downloadable.rb +0 -1
  223. data/lib/geoblacklight/routes.rb +0 -3
  224. data/lib/geoblacklight/version.rb +1 -1
  225. data/lib/geoblacklight/wms_layer/feature_info_response.rb +9 -6
  226. data/lib/geoblacklight.rb +6 -30
  227. data/lib/tasks/geoblacklight.rake +24 -60
  228. data/package.json +24 -17
  229. data/solr/conf/schema.xml +15 -13
  230. data/solr/conf/solrconfig.xml +6 -4
  231. data/spec/components/blacklight/icons/american_geographical_society_library_uwm_libraries_component_spec.rb +15 -0
  232. data/spec/components/blacklight/icons/arizona_component_spec.rb +15 -0
  233. data/spec/components/blacklight/icons/arrow_circle_down_component_spec.rb +15 -0
  234. data/spec/components/blacklight/icons/baruch_cuny_component_spec.rb +15 -0
  235. data/spec/components/blacklight/icons/book_component_spec.rb +15 -0
  236. data/spec/components/blacklight/icons/bookmark_component_spec.rb +15 -0
  237. data/spec/components/blacklight/icons/cd_rom_component_spec.rb +15 -0
  238. data/spec/components/blacklight/icons/child_item_component_spec.rb +15 -0
  239. data/spec/components/blacklight/icons/circle_info_solid_component_spec.rb +15 -0
  240. data/spec/components/blacklight/icons/citation_component_spec.rb +15 -0
  241. data/spec/components/blacklight/icons/collection_component_spec.rb +15 -0
  242. data/spec/components/blacklight/icons/collections_component_spec.rb +15 -0
  243. data/spec/components/blacklight/icons/columbia_component_spec.rb +15 -0
  244. data/spec/components/blacklight/icons/cornell_component_spec.rb +15 -0
  245. data/spec/components/blacklight/icons/datasets_component_spec.rb +15 -0
  246. data/spec/components/blacklight/icons/dvd_rom_component_spec.rb +15 -0
  247. data/spec/components/blacklight/icons/email_component_spec.rb +15 -0
  248. data/spec/components/blacklight/icons/esri_globe_component_spec.rb +15 -0
  249. data/spec/components/blacklight/icons/fire_solid_component_spec.rb +15 -0
  250. data/spec/components/blacklight/icons/george_mason_component_spec.rb +15 -0
  251. data/spec/components/blacklight/icons/globe_component_spec.rb +15 -0
  252. data/spec/components/blacklight/icons/harvard_component_spec.rb +15 -0
  253. data/spec/components/blacklight/icons/home_component_spec.rb +15 -0
  254. data/spec/components/blacklight/icons/iiif_drag_drop_component_spec.rb +15 -0
  255. data/spec/components/blacklight/icons/image_component_spec.rb +15 -0
  256. data/spec/components/blacklight/icons/imagery_component_spec.rb +15 -0
  257. data/spec/components/blacklight/icons/indiana_component_spec.rb +15 -0
  258. data/spec/components/blacklight/icons/leaf_component_spec.rb +15 -0
  259. data/spec/components/blacklight/icons/lewis_clark_component_spec.rb +15 -0
  260. data/spec/components/blacklight/icons/lightbulb_solid_component_spec.rb +15 -0
  261. data/spec/components/blacklight/icons/line_component_spec.rb +15 -0
  262. data/spec/components/blacklight/icons/map_component_spec.rb +15 -0
  263. data/spec/components/blacklight/icons/map_marker_component_spec.rb +15 -0
  264. data/spec/components/blacklight/icons/maps_component_spec.rb +15 -0
  265. data/spec/components/blacklight/icons/massgis_component_spec.rb +15 -0
  266. data/spec/components/blacklight/icons/metadata_component_spec.rb +15 -0
  267. data/spec/components/blacklight/icons/michigan_state_university_component_spec.rb +15 -0
  268. data/spec/components/blacklight/icons/mit_component_spec.rb +15 -0
  269. data/spec/components/blacklight/icons/mixed_component_spec.rb +15 -0
  270. data/spec/components/blacklight/icons/multilinestring_component_spec.rb +15 -0
  271. data/spec/components/blacklight/icons/multipoint_component_spec.rb +15 -0
  272. data/spec/components/blacklight/icons/multipolygon_component_spec.rb +15 -0
  273. data/spec/components/blacklight/icons/northwestern_university_component_spec.rb +15 -0
  274. data/spec/components/blacklight/icons/nyu_component_spec.rb +15 -0
  275. data/spec/components/blacklight/icons/pagelines_brands_component_spec.rb +15 -0
  276. data/spec/components/blacklight/icons/paper_map_component_spec.rb +15 -0
  277. data/spec/components/blacklight/icons/parent_item_component_spec.rb +15 -0
  278. data/spec/components/blacklight/icons/pennsylvania_state_university_component_spec.rb +15 -0
  279. data/spec/components/blacklight/icons/point_component_spec.rb +15 -0
  280. data/spec/components/blacklight/icons/polygon_component_spec.rb +15 -0
  281. data/spec/components/blacklight/icons/polyline_component_spec.rb +15 -0
  282. data/spec/components/blacklight/icons/princeton_component_spec.rb +15 -0
  283. data/spec/components/blacklight/icons/public_component_spec.rb +15 -0
  284. data/spec/components/blacklight/icons/purdue_university_component_spec.rb +15 -0
  285. data/spec/components/blacklight/icons/raster_component_spec.rb +15 -0
  286. data/spec/components/blacklight/icons/restricted_component_spec.rb +15 -0
  287. data/spec/components/blacklight/icons/rutgers_component_spec.rb +15 -0
  288. data/spec/components/blacklight/icons/sms_component_spec.rb +15 -0
  289. data/spec/components/blacklight/icons/stanford_component_spec.rb +15 -0
  290. data/spec/components/blacklight/icons/table_component_spec.rb +15 -0
  291. data/spec/components/blacklight/icons/tags_component_spec.rb +15 -0
  292. data/spec/components/blacklight/icons/texas_component_spec.rb +15 -0
  293. data/spec/components/blacklight/icons/the_ohio_state_university_component_spec.rb +15 -0
  294. data/spec/components/blacklight/icons/triangle_exclamation_solid_component_spec.rb +15 -0
  295. data/spec/components/blacklight/icons/tufts_component_spec.rb +15 -0
  296. data/spec/components/blacklight/icons/ucla_component_spec.rb +15 -0
  297. data/spec/components/blacklight/icons/university_of_california_berkeley_component_spec.rb +15 -0
  298. data/spec/components/blacklight/icons/university_of_chicago_component_spec.rb +15 -0
  299. data/spec/components/blacklight/icons/university_of_colorado_boulder_component_spec.rb +15 -0
  300. data/spec/components/blacklight/icons/university_of_illinois_urbana_champaign_component_spec.rb +15 -0
  301. data/spec/components/blacklight/icons/university_of_iowa_component_spec.rb +15 -0
  302. data/spec/components/blacklight/icons/university_of_maryland_component_spec.rb +15 -0
  303. data/spec/components/blacklight/icons/university_of_michigan_component_spec.rb +15 -0
  304. data/spec/components/blacklight/icons/university_of_minnesota_component_spec.rb +15 -0
  305. data/spec/components/blacklight/icons/university_of_nebraska_lincoln_component_spec.rb +15 -0
  306. data/spec/components/blacklight/icons/university_of_wisconsin_madison_component_spec.rb +15 -0
  307. data/spec/components/blacklight/icons/uva_component_spec.rb +15 -0
  308. data/spec/components/blacklight/icons/web_services_component_spec.rb +15 -0
  309. data/spec/components/blacklight/icons/websites_component_spec.rb +15 -0
  310. data/spec/components/geoblacklight/arcgis_component_spec.rb +31 -0
  311. data/spec/components/geoblacklight/attribute_table_component_spec.rb +37 -0
  312. data/spec/components/geoblacklight/citation_component_spec.rb +37 -0
  313. data/spec/components/geoblacklight/document_component_spec.rb +92 -0
  314. data/spec/components/geoblacklight/download_links_component_spec.rb +102 -0
  315. data/spec/components/geoblacklight/header_icons_component_spec.rb +56 -0
  316. data/spec/components/geoblacklight/iiif_drag_drop_component_spec.rb +30 -0
  317. data/spec/components/geoblacklight/index_map_legend_component_spec.rb +42 -0
  318. data/spec/components/geoblacklight/item_map_viewer_component_spec.rb +36 -0
  319. data/spec/components/geoblacklight/login_link_component_spec.rb +33 -0
  320. data/spec/{lib/geoblacklight/document_presenter_spec.rb → components/geoblacklight/search_result_component_spec.rb} +19 -11
  321. data/spec/components/geoblacklight/static_map_component_spec.rb +22 -0
  322. data/spec/components/geoblacklight/viewer_help_text_component_spec.rb +28 -0
  323. data/spec/components/geoblacklight/web_services_component_spec.rb +45 -0
  324. data/spec/controllers/download_controller_spec.rb +12 -35
  325. data/spec/features/axe_spec.rb +66 -0
  326. data/spec/features/bookmarks_spec.rb +1 -1
  327. data/spec/features/citations_spec.rb +7 -3
  328. data/spec/features/download_layer_spec.rb +24 -39
  329. data/spec/features/esri_viewer_spec.rb +1 -1
  330. data/spec/features/exports_spec.rb +0 -15
  331. data/spec/features/{full_screen_controll_spec.rb → full_screen_control_spec.rb} +6 -6
  332. data/spec/features/home_page_spec.rb +12 -7
  333. data/spec/features/iiif_viewer_spec.rb +1 -1
  334. data/spec/features/index_map_spec.rb +16 -9
  335. data/spec/features/{split_view.html.erb_spec.rb → index_view_spec.rb} +15 -13
  336. data/spec/features/layer_inspection_spec.rb +2 -2
  337. data/spec/features/layer_preview_spec.rb +1 -1
  338. data/spec/features/missing_metadata_spec.rb +5 -5
  339. data/spec/features/oembed_spec.rb +2 -2
  340. data/spec/features/saved_searches_spec.rb +4 -1
  341. data/spec/features/search_results_complex_geometry_spec.rb +2 -2
  342. data/spec/features/search_results_icons_spec.rb +3 -3
  343. data/spec/features/search_results_map_spec.rb +4 -36
  344. data/spec/features/search_results_overlap_ratio_spec.rb +1 -1
  345. data/spec/features/show_page_download_spec.rb +0 -8
  346. data/spec/features/tilejson_spec.rb +2 -2
  347. data/spec/features/web_services_modal_spec.rb +57 -39
  348. data/spec/features/wmts_spec.rb +4 -4
  349. data/spec/fixtures/solr_documents/README.md +2 -1
  350. data/spec/fixtures/solr_documents/complex-geom.json +61 -0
  351. data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +45 -24
  352. data/spec/fixtures/solr_documents/harvard_raster.json +1 -1
  353. data/spec/fixtures/solr_documents/multiple-downloads.json +1 -0
  354. data/spec/helpers/geoblacklight_helper_spec.rb +8 -173
  355. data/spec/lib/geoblacklight/download/csv_download_spec.rb +21 -0
  356. data/spec/lib/geoblacklight/reference_spec.rb +17 -19
  357. data/spec/lib/geoblacklight/references_spec.rb +31 -17
  358. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +8 -6
  359. data/spec/lib/geoblacklight/wms_layer_spec.rb +14 -0
  360. data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -1
  361. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +1 -21
  362. data/spec/spec_helper.rb +2 -28
  363. data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -12
  364. data/template.rb +13 -11
  365. data/test/leaflet/layers.test.js +17 -0
  366. data/vite.config.ts +34 -23
  367. metadata +304 -256
  368. data/.hound.yml +0 -8
  369. data/.jshintignore +0 -2
  370. data/.jshintrc +0 -67
  371. data/.solr_wrapper +0 -6
  372. data/app/assets/images/blacklight/american-geographical-society-library-uwm-libraries.svg +0 -26
  373. data/app/assets/images/blacklight/arizona.svg +0 -4
  374. data/app/assets/images/blacklight/arrow-circle-down.svg +0 -3
  375. data/app/assets/images/blacklight/baruch-cuny.svg +0 -3
  376. data/app/assets/images/blacklight/book.svg +0 -3
  377. data/app/assets/images/blacklight/bookmark.svg +0 -3
  378. data/app/assets/images/blacklight/cd-rom.svg +0 -3
  379. data/app/assets/images/blacklight/chicago.svg +0 -4
  380. data/app/assets/images/blacklight/child-item.svg +0 -3
  381. data/app/assets/images/blacklight/circle-info-solid.svg +0 -1
  382. data/app/assets/images/blacklight/citation.svg +0 -3
  383. data/app/assets/images/blacklight/collection.svg +0 -3
  384. data/app/assets/images/blacklight/collections.svg +0 -4
  385. data/app/assets/images/blacklight/columbia.svg +0 -3
  386. data/app/assets/images/blacklight/cornell.svg +0 -5
  387. data/app/assets/images/blacklight/datasets.svg +0 -7
  388. data/app/assets/images/blacklight/dvd-rom.svg +0 -3
  389. data/app/assets/images/blacklight/email.svg +0 -3
  390. data/app/assets/images/blacklight/esri-globe.svg +0 -31
  391. data/app/assets/images/blacklight/fire-solid.svg +0 -1
  392. data/app/assets/images/blacklight/geoblacklight-icons.json +0 -3312
  393. data/app/assets/images/blacklight/george-mason.svg +0 -4
  394. data/app/assets/images/blacklight/globe.svg +0 -3
  395. data/app/assets/images/blacklight/harvard.svg +0 -3
  396. data/app/assets/images/blacklight/home.svg +0 -3
  397. data/app/assets/images/blacklight/illinois.svg +0 -4
  398. data/app/assets/images/blacklight/image.svg +0 -3
  399. data/app/assets/images/blacklight/imagery.svg +0 -4
  400. data/app/assets/images/blacklight/indiana.svg +0 -3
  401. data/app/assets/images/blacklight/iowa.svg +0 -3
  402. data/app/assets/images/blacklight/leaf.svg +0 -3
  403. data/app/assets/images/blacklight/lewis-clark.svg +0 -5
  404. data/app/assets/images/blacklight/lightbulb-solid.svg +0 -1
  405. data/app/assets/images/blacklight/line.svg +0 -4
  406. data/app/assets/images/blacklight/map-marker.svg +0 -3
  407. data/app/assets/images/blacklight/map.svg +0 -3
  408. data/app/assets/images/blacklight/maps.svg +0 -4
  409. data/app/assets/images/blacklight/maryland.svg +0 -3
  410. data/app/assets/images/blacklight/massgis.svg +0 -3
  411. data/app/assets/images/blacklight/metadata.svg +0 -3
  412. data/app/assets/images/blacklight/michigan-state-university.svg +0 -5
  413. data/app/assets/images/blacklight/michigan-state.svg +0 -4
  414. data/app/assets/images/blacklight/michigan.svg +0 -3
  415. data/app/assets/images/blacklight/minnesota.svg +0 -3
  416. data/app/assets/images/blacklight/mit.svg +0 -3
  417. data/app/assets/images/blacklight/mixed.svg +0 -5
  418. data/app/assets/images/blacklight/multilinestring.svg +0 -6
  419. data/app/assets/images/blacklight/multipoint.svg +0 -3
  420. data/app/assets/images/blacklight/multipolygon.svg +0 -6
  421. data/app/assets/images/blacklight/nebraska.svg +0 -4
  422. data/app/assets/images/blacklight/northwestern-university.svg +0 -5
  423. data/app/assets/images/blacklight/nyu.svg +0 -6
  424. data/app/assets/images/blacklight/ohio-state.svg +0 -5
  425. data/app/assets/images/blacklight/pagelines-brands.svg +0 -3
  426. data/app/assets/images/blacklight/paper-map.svg +0 -3
  427. data/app/assets/images/blacklight/parent-item.svg +0 -3
  428. data/app/assets/images/blacklight/penn-state.svg +0 -4
  429. data/app/assets/images/blacklight/pennsylvania-state-university.svg +0 -5
  430. data/app/assets/images/blacklight/point.svg +0 -3
  431. data/app/assets/images/blacklight/polygon.svg +0 -4
  432. data/app/assets/images/blacklight/polyline.svg +0 -6
  433. data/app/assets/images/blacklight/princeton.svg +0 -3
  434. data/app/assets/images/blacklight/public.svg +0 -3
  435. data/app/assets/images/blacklight/purdue-university.svg +0 -5
  436. data/app/assets/images/blacklight/purdue.svg +0 -4
  437. data/app/assets/images/blacklight/raster.svg +0 -3
  438. data/app/assets/images/blacklight/restricted.svg +0 -3
  439. data/app/assets/images/blacklight/rutgers.svg +0 -5
  440. data/app/assets/images/blacklight/sms.svg +0 -3
  441. data/app/assets/images/blacklight/stanford.svg +0 -3
  442. data/app/assets/images/blacklight/table.svg +0 -3
  443. data/app/assets/images/blacklight/tags.svg +0 -3
  444. data/app/assets/images/blacklight/texas.svg +0 -3
  445. data/app/assets/images/blacklight/the-ohio-state-university.svg +0 -6
  446. data/app/assets/images/blacklight/triangle-exclamation-solid.svg +0 -1
  447. data/app/assets/images/blacklight/tufts.svg +0 -3
  448. data/app/assets/images/blacklight/ucla.svg +0 -3
  449. data/app/assets/images/blacklight/university-of-california-berkeley.svg +0 -4
  450. data/app/assets/images/blacklight/university-of-chicago.svg +0 -5
  451. data/app/assets/images/blacklight/university-of-colorado-boulder.svg +0 -6
  452. data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +0 -5
  453. data/app/assets/images/blacklight/university-of-iowa.svg +0 -4
  454. data/app/assets/images/blacklight/university-of-maryland.svg +0 -4
  455. data/app/assets/images/blacklight/university-of-michigan.svg +0 -4
  456. data/app/assets/images/blacklight/university-of-minnesota.svg +0 -4
  457. data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +0 -7
  458. data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +0 -4
  459. data/app/assets/images/blacklight/uva.svg +0 -3
  460. data/app/assets/images/blacklight/web_services.svg +0 -3
  461. data/app/assets/images/blacklight/websites.svg +0 -4
  462. data/app/assets/images/blacklight/wisconsin.svg +0 -3
  463. data/app/assets/javascripts/geoblacklight/basemaps.js +0 -85
  464. data/app/assets/javascripts/geoblacklight/controls/fullscreen.js +0 -8
  465. data/app/assets/javascripts/geoblacklight/controls/opacity.js +0 -6
  466. data/app/assets/javascripts/geoblacklight/controls.js +0 -1
  467. data/app/assets/javascripts/geoblacklight/downloaders/downloader.js +0 -61
  468. data/app/assets/javascripts/geoblacklight/downloaders/hgl_downloader.js +0 -32
  469. data/app/assets/javascripts/geoblacklight/downloaders.js +0 -1
  470. data/app/assets/javascripts/geoblacklight/geoblacklight.js +0 -60
  471. data/app/assets/javascripts/geoblacklight/modules/bookmarks.js +0 -43
  472. data/app/assets/javascripts/geoblacklight/modules/download.js +0 -11
  473. data/app/assets/javascripts/geoblacklight/modules/geosearch.js +0 -133
  474. data/app/assets/javascripts/geoblacklight/modules/help_text.js +0 -7
  475. data/app/assets/javascripts/geoblacklight/modules/home.js +0 -16
  476. data/app/assets/javascripts/geoblacklight/modules/item.js +0 -32
  477. data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +0 -68
  478. data/app/assets/javascripts/geoblacklight/modules/metadata.js +0 -15
  479. data/app/assets/javascripts/geoblacklight/modules/metadata_download_button.js +0 -58
  480. data/app/assets/javascripts/geoblacklight/modules/relations.js +0 -14
  481. data/app/assets/javascripts/geoblacklight/modules/results.js +0 -81
  482. data/app/assets/javascripts/geoblacklight/modules/svg_tooltips.js +0 -31
  483. data/app/assets/javascripts/geoblacklight/modules/util.js +0 -48
  484. data/app/assets/javascripts/geoblacklight/modules.js +0 -1
  485. data/app/assets/javascripts/geoblacklight/templates/index_map_download.hbs +0 -19
  486. data/app/assets/javascripts/geoblacklight/templates/index_map_info.hbs +0 -61
  487. data/app/assets/javascripts/geoblacklight/viewers/cog.js +0 -5
  488. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +0 -85
  489. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +0 -76
  490. data/app/assets/javascripts/geoblacklight/viewers/esri/image_map_layer.js +0 -14
  491. data/app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js +0 -50
  492. data/app/assets/javascripts/geoblacklight/viewers/esri.js +0 -78
  493. data/app/assets/javascripts/geoblacklight/viewers/iiif.js +0 -25
  494. data/app/assets/javascripts/geoblacklight/viewers/index_map.js +0 -71
  495. data/app/assets/javascripts/geoblacklight/viewers/map.js +0 -77
  496. data/app/assets/javascripts/geoblacklight/viewers/oembed.js +0 -13
  497. data/app/assets/javascripts/geoblacklight/viewers/pmtiles.js +0 -5
  498. data/app/assets/javascripts/geoblacklight/viewers/tilejson.js +0 -33
  499. data/app/assets/javascripts/geoblacklight/viewers/tms.js +0 -10
  500. data/app/assets/javascripts/geoblacklight/viewers/viewer.js +0 -68
  501. data/app/assets/javascripts/geoblacklight/viewers/wms.js +0 -74
  502. data/app/assets/javascripts/geoblacklight/viewers/wmts.js +0 -85
  503. data/app/assets/javascripts/geoblacklight/viewers/xyz.js +0 -10
  504. data/app/assets/javascripts/geoblacklight/viewers.js +0 -1
  505. data/app/assets/stylesheets/geoblacklight/modules/mixins.scss +0 -5
  506. data/app/helpers/arcgis_helper.rb +0 -14
  507. data/app/helpers/blacklight_helper.rb +0 -11
  508. data/app/helpers/carto_helper.rb +0 -31
  509. data/app/helpers/geoblacklight/geoblacklight_helper_behavior.rb +0 -18
  510. data/app/javascript/clover/clover_initializer.js +0 -29
  511. data/app/javascript/index.js +0 -7
  512. data/app/javascript/openlayers/basemaps.js +0 -47
  513. data/app/javascript/openlayers/ol_initializer.js +0 -106
  514. data/app/javascript/stylesheets/openlayers.css +0 -1
  515. data/app/models/concerns/geoblacklight/solr_document/carto.rb +0 -17
  516. data/app/views/catalog/_arcgis.html.erb +0 -4
  517. data/app/views/catalog/_carto.html.erb +0 -4
  518. data/app/views/catalog/_data_dictionary.html.erb +0 -5
  519. data/app/views/catalog/_downloads_collapse.html.erb +0 -27
  520. data/app/views/catalog/_header_icons.html.erb +0 -3
  521. data/app/views/catalog/_index_split_default.html.erb +0 -30
  522. data/app/views/catalog/_results_pagination.html.erb +0 -12
  523. data/app/views/catalog/_show_default_attribute_table.html.erb +0 -19
  524. data/app/views/catalog/_show_default_display_note.html.erb +0 -7
  525. data/app/views/catalog/_show_default_viewer_container.html.erb +0 -28
  526. data/app/views/catalog/_show_downloads.html.erb +0 -23
  527. data/app/views/catalog/_show_header_default.html.erb +0 -4
  528. data/app/views/catalog/_show_sidebar.html.erb +0 -16
  529. data/app/views/catalog/_show_sidebar_static_map.html.erb +0 -10
  530. data/app/views/catalog/_show_web_services.html.erb +0 -11
  531. data/app/views/catalog/_web_services.html.erb +0 -9
  532. data/app/views/catalog/_web_services_wms.html.erb +0 -13
  533. data/app/views/download/hgl.html.erb +0 -27
  534. data/app/views/relation/_relations.html.erb +0 -15
  535. data/app/views/shared/_header_navbar.html.erb +0 -46
  536. data/babel.config.json +0 -4
  537. data/jest.config.js +0 -25
  538. data/lib/generators/geoblacklight/templates/assets/_blacklight.scss +0 -1
  539. data/lib/generators/geoblacklight/templates/assets/_geoblacklight.scss +0 -1
  540. data/lib/generators/geoblacklight/templates/assets/geoblacklight.js +0 -9
  541. data/lib/generators/geoblacklight/templates/clover.js +0 -5
  542. data/lib/generators/geoblacklight/templates/ol.js +0 -6
  543. data/lib/generators/geoblacklight/templates/package-test.json +0 -10
  544. data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +0 -195
  545. data/lib/geoblacklight/download/hgl_download.rb +0 -20
  546. data/lib/geoblacklight/view_helper_override.rb +0 -16
  547. data/setupJest.js +0 -14
  548. data/spec/helpers/arcgis_helper_spec.rb +0 -16
  549. data/spec/helpers/carto_helper_spec.rb +0 -13
  550. data/spec/helpers/geoblacklight/geoblacklight_helper_behavior_spec.rb +0 -27
  551. data/spec/javascripts/util_spec.js +0 -10
  552. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +0 -62
  553. data/spec/lib/geoblacklight/view_helper_override_spec.rb +0 -29
  554. data/spec/models/concerns/geoblacklight/solr_document/carto_spec.rb +0 -43
  555. data/spec/test_app_templates/Gemfile.extra +0 -2
  556. data/spec/views/catalog/_document_split.html.erb_spec.rb +0 -7
  557. data/spec/views/catalog/_index_split.html.erb_spec.rb +0 -7
  558. data/spec/views/catalog/_results_pagination.html.erb_spec.rb +0 -11
  559. data/spec/views/catalog/_show_downloads.html.erb_spec.rb +0 -43
  560. data/spec/views/catalog/_show_tools.html.erb_spec.rb +0 -38
  561. data/vendor/assets/images/fullscreen.png +0 -0
  562. data/vendor/assets/images/fullscreen@2x.png +0 -0
  563. data/vendor/assets/images/layers-2x.png +0 -0
  564. data/vendor/assets/images/layers.png +0 -0
  565. data/vendor/assets/images/marker-icon-2x.png +0 -0
  566. data/vendor/assets/images/marker-icon.png +0 -0
  567. data/vendor/assets/images/marker-shadow.png +0 -0
  568. data/vendor/assets/javascripts/Leaflet.fullscreen.js +0 -152
  569. data/vendor/assets/javascripts/esri-leaflet.js +0 -12
  570. data/vendor/assets/javascripts/esri-leaflet.js.map +0 -1
  571. data/vendor/assets/javascripts/leaflet-iiif.js +0 -323
  572. data/vendor/assets/javascripts/leaflet-src.js.erb +0 -14126
  573. data/vendor/assets/javascripts/leaflet-src.js.map +0 -1
  574. data/vendor/assets/javascripts/native.history.js +0 -1
  575. data/vendor/assets/stylesheets/leaflet.css +0 -640
  576. data/vendor/assets/stylesheets/leaflet.fullscreen.css +0 -40
  577. /data/app/{views/catalog/_show_default_viewer_information.html.erb → components/geoblacklight/index_map_inspect_component.html.erb} +0 -0
@@ -1,152 +0,0 @@
1
- L.Control.Fullscreen = L.Control.extend({
2
- options: {
3
- position: 'topleft',
4
- title: {
5
- 'false': 'View Fullscreen',
6
- 'true': 'Exit Fullscreen'
7
- }
8
- },
9
-
10
- onAdd: function (map) {
11
- var container = L.DomUtil.create('div', 'leaflet-control-fullscreen leaflet-bar leaflet-control');
12
-
13
- this.link = L.DomUtil.create('a', 'leaflet-control-fullscreen-button leaflet-bar-part', container);
14
- this.link.href = '#';
15
-
16
- this._map = map;
17
- this._map.on('fullscreenchange', this._toggleTitle, this);
18
- this._toggleTitle();
19
-
20
- L.DomEvent.on(this.link, 'click', this._click, this);
21
-
22
- return container;
23
- },
24
-
25
- _click: function (e) {
26
- L.DomEvent.stopPropagation(e);
27
- L.DomEvent.preventDefault(e);
28
- this._map.toggleFullscreen(this.options);
29
- },
30
-
31
- _toggleTitle: function() {
32
- this.link.title = this.options.title[this._map.isFullscreen()];
33
- }
34
- });
35
-
36
- L.Map.include({
37
- isFullscreen: function () {
38
- return this._isFullscreen || false;
39
- },
40
-
41
- toggleFullscreen: function (options) {
42
- var container = this.getContainer();
43
- if (this.isFullscreen()) {
44
- if (options && options.pseudoFullscreen) {
45
- this._disablePseudoFullscreen(container);
46
- } else if (document.exitFullscreen) {
47
- document.exitFullscreen();
48
- } else if (document.mozCancelFullScreen) {
49
- document.mozCancelFullScreen();
50
- } else if (document.webkitCancelFullScreen) {
51
- document.webkitCancelFullScreen();
52
- } else if (document.msExitFullscreen) {
53
- document.msExitFullscreen();
54
- } else {
55
- this._disablePseudoFullscreen(container);
56
- }
57
- } else {
58
- if (options && options.pseudoFullscreen) {
59
- this._enablePseudoFullscreen(container);
60
- } else if (container.requestFullscreen) {
61
- container.requestFullscreen();
62
- } else if (container.mozRequestFullScreen) {
63
- container.mozRequestFullScreen();
64
- } else if (container.webkitRequestFullscreen) {
65
- container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
66
- } else if (container.msRequestFullscreen) {
67
- container.msRequestFullscreen();
68
- } else {
69
- this._enablePseudoFullscreen(container);
70
- }
71
- }
72
-
73
- },
74
-
75
- _enablePseudoFullscreen: function (container) {
76
- L.DomUtil.addClass(container, 'leaflet-pseudo-fullscreen');
77
- this._setFullscreen(true);
78
- this.fire('fullscreenchange');
79
- },
80
-
81
- _disablePseudoFullscreen: function (container) {
82
- L.DomUtil.removeClass(container, 'leaflet-pseudo-fullscreen');
83
- this._setFullscreen(false);
84
- this.fire('fullscreenchange');
85
- },
86
-
87
- _setFullscreen: function(fullscreen) {
88
- this._isFullscreen = fullscreen;
89
- var container = this.getContainer();
90
- if (fullscreen) {
91
- L.DomUtil.addClass(container, 'leaflet-fullscreen-on');
92
- } else {
93
- L.DomUtil.removeClass(container, 'leaflet-fullscreen-on');
94
- }
95
- this.invalidateSize();
96
- },
97
-
98
- _onFullscreenChange: function (e) {
99
- var fullscreenElement =
100
- document.fullscreenElement ||
101
- document.mozFullScreenElement ||
102
- document.webkitFullscreenElement ||
103
- document.msFullscreenElement;
104
-
105
- if (fullscreenElement === this.getContainer() && !this._isFullscreen) {
106
- this._setFullscreen(true);
107
- this.fire('fullscreenchange');
108
- } else if (fullscreenElement !== this.getContainer() && this._isFullscreen) {
109
- this._setFullscreen(false);
110
- this.fire('fullscreenchange');
111
- }
112
- }
113
- });
114
-
115
- L.Map.mergeOptions({
116
- fullscreenControl: false
117
- });
118
-
119
- L.Map.addInitHook(function () {
120
- if (this.options.fullscreenControl) {
121
- this.fullscreenControl = new L.Control.Fullscreen(this.options.fullscreenControl);
122
- this.addControl(this.fullscreenControl);
123
- }
124
-
125
- var fullscreenchange;
126
-
127
- if ('onfullscreenchange' in document) {
128
- fullscreenchange = 'fullscreenchange';
129
- } else if ('onmozfullscreenchange' in document) {
130
- fullscreenchange = 'mozfullscreenchange';
131
- } else if ('onwebkitfullscreenchange' in document) {
132
- fullscreenchange = 'webkitfullscreenchange';
133
- } else if ('onmsfullscreenchange' in document) {
134
- fullscreenchange = 'MSFullscreenChange';
135
- }
136
-
137
- if (fullscreenchange) {
138
- var onFullscreenChange = L.bind(this._onFullscreenChange, this);
139
-
140
- this.whenReady(function () {
141
- L.DomEvent.on(document, fullscreenchange, onFullscreenChange);
142
- });
143
-
144
- this.on('unload', function () {
145
- L.DomEvent.off(document, fullscreenchange, onFullscreenChange);
146
- });
147
- }
148
- });
149
-
150
- L.control.fullscreen = function (options) {
151
- return new L.Control.Fullscreen(options);
152
- };
@@ -1,12 +0,0 @@
1
- /* esri-leaflet - v3.0.4 - Mon Dec 06 2021 15:19:56 GMT-0600 (Central Standard Time)
2
- * Copyright (c) 2021 Environmental Systems Research Institute, Inc.
3
- * Apache-2.0 */
4
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).L=t.L||{},t.L.esri={}),t.L)}(this,function(t,g){"use strict";var e="3.0.4",i=window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest,s=""===document.documentElement.style.pointerEvents,a={cors:i,pointerEvents:s},r={attributionWidthOffset:55},n=0;function l(t){var e,i,s,r="";for(var o in t.f=t.f||"json",t){t.hasOwnProperty(o)&&(e=t[o],i=Object.prototype.toString.call(e),r.length&&(r+="&"),s="[object Array]"===i?"[object Object]"===Object.prototype.toString.call(e[0])?JSON.stringify(e):e.join(","):"[object Object]"===i?JSON.stringify(e):"[object Date]"===i?e.valueOf():e,r+=encodeURIComponent(o)+"="+encodeURIComponent(s))}return r}function u(s,r){var o=new window.XMLHttpRequest;return o.onerror=function(t){o.onreadystatechange=g.Util.falseFn,s.call(r,{error:{code:500,message:"XMLHttpRequest error"}},null)},o.onreadystatechange=function(){var e,i;if(4===o.readyState){try{e=JSON.parse(o.responseText)}catch(t){e=null,i={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}!i&&e.error&&(i=e.error,e=null),o.onerror=g.Util.falseFn,s.call(r,i,e)}},o.ontimeout=function(){this.onerror()},o}function o(t,e,i,s){var r=u(i,s);return r.open("POST",t),null!=s&&void 0!==s.options&&(r.timeout=s.options.timeout),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),r.send(l(e)),r}function h(t,e,i,s){var r=u(i,s);return r.open("GET",t+"?"+l(e),!0),null!=s&&void 0!==s.options&&(r.timeout=s.options.timeout,s.options.withCredentials&&(r.withCredentials=!0)),r.send(null),r}function c(t,e,i,s){var r=l(e),o=u(i,s),n=(t+"?"+r).length;if(n<=2e3&&a.cors?o.open("GET",t+"?"+r):2e3<n&&a.cors&&(o.open("POST",t),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8")),null!=s&&void 0!==s.options&&(o.timeout=s.options.timeout,s.options.withCredentials&&(o.withCredentials=!0)),n<=2e3&&a.cors)o.send(null);else{if(!(2e3<n&&a.cors))return n<=2e3&&!a.cors?p(t,e,i,s):void m("a request to "+t+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");o.send(r)}return o}function p(t,e,s,r){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var o="c"+n;e.callback="window._EsriLeafletCallbacks."+o,window._EsriLeafletCallbacks[o]=function(t){var e,i;!0!==window._EsriLeafletCallbacks[o]&&("[object Object]"!==(i=Object.prototype.toString.call(t))&&"[object Array]"!==i&&(e={error:{code:500,message:"Expected array or object as JSONP response"}},t=null),!e&&t.error&&(e=t,t=null),s.call(r,e,t),window._EsriLeafletCallbacks[o]=!0)};var i=g.DomUtil.create("script",null,document.body);return i.type="text/javascript",i.src=t+"?"+l(e),i.id=o,i.onerror=function(t){t&&!0!==window._EsriLeafletCallbacks[o]&&(s.call(r,{error:{code:500,message:"An unknown error occurred"}}),window._EsriLeafletCallbacks[o]=!0)},g.DomUtil.addClass(i,"esri-leaflet-jsonp"),n++,{id:o,url:i.src,abort:function(){window._EsriLeafletCallbacks._callback[o]({code:0,message:"Request aborted."})}}}var d=a.cors?h:p;function m(){console&&console.warn&&console.warn.apply(console,arguments)}d.CORS=h,d.JSONP=p;function y(t,e){for(var i=0;i<t.length-1;i++)for(var s=0;s<e.length-1;s++)if(function(t,e,i,s){var r=(s[0]-i[0])*(t[1]-i[1])-(s[1]-i[1])*(t[0]-i[0]),o=(e[0]-t[0])*(t[1]-i[1])-(e[1]-t[1])*(t[0]-i[0]),n=(s[1]-i[1])*(e[0]-t[0])-(s[0]-i[0])*(e[1]-t[1]);if(0!=n){var a=r/n,l=o/n;if(0<=a&&a<=1&&0<=l&&l<=1)return!0}return!1}(t[i],t[i+1],e[s],e[s+1]))return!0;return!1}function _(t){return function(t,e){for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}(t[0],t[t.length-1])||t.push(t[0]),t}function v(t){for(var e,i=0,s=0,r=t.length,o=t[s];s<r-1;s++)i+=((e=t[s+1])[0]-o[0])*(e[1]+o[1]),o=e;return 0<=i}function f(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function b(t){for(var e,i,s=[],r=[],o=0;o<t.length;o++){var n,a=_(t[o].slice(0));a.length<4||(v(a)?(n=[a.slice().reverse()],s.push(n)):r.push(a.slice().reverse()))}for(var l,u,h,c,p=[];r.length;){i=r.pop();for(var d=!1,m=s.length-1;0<=m;m--)if(e=s[m][0],h=void 0,h=y(l=e,u=i),c=function(t,e){for(var i=!1,s=-1,r=t.length,o=r-1;++s<r;o=s)(t[s][1]<=e[1]&&e[1]<t[o][1]||t[o][1]<=e[1]&&e[1]<t[s][1])&&e[0]<(t[o][0]-t[s][0])*(e[1]-t[s][1])/(t[o][1]-t[s][1])+t[s][0]&&(i=!i);return i}(l,u[0]),!h&&c){s[m].push(i),d=!0;break}d||p.push(i)}for(;p.length;){i=p.pop();var f=!1;for(m=s.length-1;0<=m;m--)if(e=s[m][0],y(e,i)){s[m].push(i),f=!0;break}f||s.push([i.reverse()])}return 1===s.length?{type:"Polygon",coordinates:s[0]}:{type:"MultiPolygon",coordinates:s}}function x(t){var e=[],i=t.slice(0),s=_(i.shift().slice(0));if(4<=s.length){v(s)||s.reverse(),e.push(s);for(var r=0;r<i.length;r++){var o=_(i[r].slice(0));4<=o.length&&(v(o)&&o.reverse(),e.push(o))}}return e}var S={request:c,get:d,post:o},L=function t(e,i){var s={};if(e.features){s.type="FeatureCollection",s.features=[];for(var r=0;r<e.features.length;r++)s.features.push(t(e.features[r],i))}if("number"==typeof e.x&&"number"==typeof e.y&&(s.type="Point",s.coordinates=[e.x,e.y],"number"==typeof e.z&&s.coordinates.push(e.z)),e.points&&(s.type="MultiPoint",s.coordinates=e.points.slice(0)),e.paths&&(1===e.paths.length?(s.type="LineString",s.coordinates=e.paths[0].slice(0)):(s.type="MultiLineString",s.coordinates=e.paths.slice(0))),e.rings&&(s=b(e.rings.slice(0))),"number"==typeof e.xmin&&"number"==typeof e.ymin&&"number"==typeof e.xmax&&"number"==typeof e.ymax&&(s.type="Polygon",s.coordinates=[[[e.xmax,e.ymax],[e.xmin,e.ymax],[e.xmin,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax]]]),(e.geometry||e.attributes)&&(s.type="Feature",s.geometry=e.geometry?t(e.geometry):null,s.properties=e.attributes?f(e.attributes):null,e.attributes))try{s.id=function(t,e){for(var i=e?[e,"OBJECTID","FID"]:["OBJECTID","FID"],s=0;s<i.length;s++){var r=i[s];if(r in t&&("string"==typeof t[r]||"number"==typeof t[r]))return t[r]}throw Error("No valid id attribute found")}(e.attributes,i)}catch(t){}return JSON.stringify(s.geometry)===JSON.stringify({})&&(s.geometry=null),e.spatialReference&&e.spatialReference.wkid&&4326!==e.spatialReference.wkid&&console.warn("Object converted in non-standard crs - "+JSON.stringify(e.spatialReference)),s},A=function t(e,i){i=i||"OBJECTID";var s,r={wkid:4326},o={};switch(e.type){case"Point":o.x=e.coordinates[0],o.y=e.coordinates[1],o.spatialReference=r;break;case"MultiPoint":o.points=e.coordinates.slice(0),o.spatialReference=r;break;case"LineString":o.paths=[e.coordinates.slice(0)],o.spatialReference=r;break;case"MultiLineString":o.paths=e.coordinates.slice(0),o.spatialReference=r;break;case"Polygon":o.rings=x(e.coordinates.slice(0)),o.spatialReference=r;break;case"MultiPolygon":o.rings=function(t){for(var e=[],i=0;i<t.length;i++)for(var s=x(t[i]),r=s.length-1;0<=r;r--){var o=s[r].slice(0);e.push(o)}return e}(e.coordinates.slice(0)),o.spatialReference=r;break;case"Feature":e.geometry&&(o.geometry=t(e.geometry,i)),o.attributes=e.properties?f(e.properties):{},e.id&&(o.attributes[i]=e.id);break;case"FeatureCollection":for(o=[],s=0;s<e.features.length;s++)o.push(t(e.features[s],i));break;case"GeometryCollection":for(o=[],s=0;s<e.geometries.length;s++)o.push(t(e.geometries[s],i))}return o},I='<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>';
5
- /* @preserve
6
- * @terraformer/arcgis - v2.0.6 - MIT
7
- * Copyright (c) 2012-2020 Environmental Systems Research Institute, Inc.
8
- * Mon May 18 2020 14:30:35 GMT-0700 (Pacific Daylight Time)
9
- */
10
- /* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
11
- * Apache-2.0 */function T(t,e){return A(t,e)}function C(t,e){return L(t,e)}function w(t){if("NaN"===t.xmin||"NaN"===t.ymin||"NaN"===t.xmax||"NaN"===t.ymax)return null;var e=g.latLng(t.ymin,t.xmin),i=g.latLng(t.ymax,t.xmax);return g.latLngBounds(e,i)}function R(t){return{xmin:(t=g.latLngBounds(t)).getSouthWest().lng,ymin:t.getSouthWest().lat,xmax:t.getNorthEast().lng,ymax:t.getNorthEast().lat,spatialReference:{wkid:4326}}}var P=/^(OBJECTID|FID|OID|ID)$/i;function F(t){var e;if(t.objectIdFieldName)e=t.objectIdFieldName;else if(t.fields){for(var i=0;i<=t.fields.length-1;i++)if("esriFieldTypeOID"===t.fields[i].type){e=t.fields[i].name;break}if(!e)for(i=0;i<=t.fields.length-1;i++)if(t.fields[i].name.match(P)){e=t.fields[i].name;break}}return e}function O(t){for(var e in t.attributes)if(e.match(P))return e}function k(t,e){var i=t.features||t.results,s=i&&i.length,r=e||F(t),o={type:"FeatureCollection",features:[]};if(s)for(var n=i.length-1;0<=n;n--){var a=C(i[n],r||O(i[n]));o.features.push(a)}return o}function M(t){return"/"!==(t=g.Util.trim(t))[t.length-1]&&(t+="/"),t}function U(t){var e;return-1!==t.url.indexOf("?")&&(t.requestParams=t.requestParams||{},e=t.url.substring(t.url.indexOf("?")+1),t.url=t.url.split("?")[0],t.requestParams=JSON.parse('{"'+decodeURI(e).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')),t.url=M(t.url.split("?")[0]),t}function G(t){return/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i.test(t)}function D(t){var e;switch(t){case"Point":e="esriGeometryPoint";break;case"MultiPoint":e="esriGeometryMultipoint";break;case"LineString":case"MultiLineString":e="esriGeometryPolyline";break;case"Polygon":case"MultiPolygon":e="esriGeometryPolygon"}return e}function q(t){return t.getSize().x-r.attributionWidthOffset+"px"}function E(e){var t,i;e.attributionControl&&(e.attributionControl._esriAttributionLayerCount||(e.attributionControl._esriAttributionLayerCount=0),0===e.attributionControl._esriAttributionLayerCount&&(e.attributionControl._esriAttributionAddedOnce||((t=document.createElement("style")).type="text/css",t.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}",document.getElementsByTagName("head")[0].appendChild(t),(i=document.createElement("style")).type="text/css",i.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+q(e)+";}",document.getElementsByTagName("head")[0].appendChild(i),e.on("resize",function(t){e.attributionControl&&(e.attributionControl._container.style.maxWidth=q(t.target))}),e.attributionControl._esriAttributionAddedOnce=!0),e.attributionControl.setPrefix(I+' | Powered by <a href="https://www.esri.com">Esri</a>'),g.DomUtil.addClass(e.attributionControl._container,"esri-truncated-attribution:hover"),g.DomUtil.addClass(e.attributionControl._container,"esri-truncated-attribution")),e.attributionControl._esriAttributionLayerCount=e.attributionControl._esriAttributionLayerCount+1)}function B(t){t.attributionControl&&(t.attributionControl._esriAttributionLayerCount&&1===t.attributionControl._esriAttributionLayerCount&&(t.attributionControl.setPrefix(I),g.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution:hover"),g.DomUtil.removeClass(t.attributionControl._container,"esri-truncated-attribution")),t.attributionControl._esriAttributionLayerCount=t.attributionControl._esriAttributionLayerCount-1)}function z(t){var e={geometry:null,geometryType:null};return t instanceof g.LatLngBounds?(e.geometry=R(t),e.geometryType="esriGeometryEnvelope",e):(t.getLatLng&&(t=t.getLatLng()),t instanceof g.LatLng&&(t={type:"Point",coordinates:[t.lng,t.lat]}),t instanceof g.GeoJSON&&(t=t.getLayers()[0].feature.geometry,e.geometry=T(t),e.geometryType=D(t.type)),t.toGeoJSON&&(t=t.toGeoJSON()),"Feature"===t.type&&(t=t.geometry),"Point"===t.type||"LineString"===t.type||"Polygon"===t.type||"MultiPolygon"===t.type?(e.geometry=T(t),e.geometryType=D(t.type),e):void m("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object"))}function Z(t,l){a.cors&&c(t,{},g.Util.bind(function(t,e){if(!t){l._esriAttributions=[];for(var i=0;i<e.contributors.length;i++)for(var s=e.contributors[i],r=0;r<s.coverageAreas.length;r++){var o=s.coverageAreas[r],n=g.latLng(o.bbox[0],o.bbox[1]),a=g.latLng(o.bbox[2],o.bbox[3]);l._esriAttributions.push({attribution:s.attribution,score:o.score,bounds:g.latLngBounds(n,a),minZoom:o.zoomMin,maxZoom:o.zoomMax})}l._esriAttributions.sort(function(t,e){return e.score-t.score}),N({target:l})}},this))}function N(t){var e=t.target,i=e._esriAttributions;if(e&&e.attributionControl){var s=e.attributionControl._container.querySelector(".esri-dynamic-attribution");if(s&&i){for(var r="",o=e.getBounds(),n=g.latLngBounds(o.getSouthWest().wrap(),o.getNorthEast().wrap()),a=e.getZoom(),l=0;l<i.length;l++){var u=i[l],h=u.attribution;!r.match(h)&&u.bounds.intersects(n)&&a>=u.minZoom&&a<=u.maxZoom&&(r+=", "+h)}r=r.substr(2),s.innerHTML=r,s.style.maxWidth=q(e),e.fire("attributionupdated",{attribution:r})}}}var j={warn:m,cleanUrl:M,getUrlParams:U,isArcgisOnline:G,geojsonTypeToArcGIS:D,responseToFeatureCollection:k,geojsonToArcGIS:T,arcgisToGeoJSON:C,boundsToExtent:R,extentToBounds:w,calcAttributionWidth:q,setEsriAttribution:E,_setGeometry:z,_getAttributionData:Z,_updateMapAttribution:N,_findIdAttributeFromFeature:O,_findIdAttributeFromResponse:F},W=g.Class.extend({options:{proxy:!1,useCors:i},generateSetter:function(e,t){return g.Util.bind(function(t){return this.params[e]=t,this},t)},initialize:function(t){if(t.request&&t.options?(this._service=t,g.Util.setOptions(this,t.options)):(g.Util.setOptions(this,t),this.options.url=M(t.url)),this.params=g.Util.extend({},this.params||{}),this.setters)for(var e in this.setters){var i=this.setters[e];this[e]=this.generateSetter(i,this)}},token:function(t){return this._service?this._service.authenticate(t):this.params.token=t,this},apikey:function(t){return this.token(t)},format:function(t){return this.params.returnUnformattedValues=!t,this},request:function(t,e){return this.options.requestParams&&g.Util.extend(this.params,this.options.requestParams),this._service?this._service.request(this.path,this.params,t,e):this._request("request",this.path,this.params,t,e)},_request:function(t,e,i,s,r){var o=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?S[t](o,i,s,r):S.get.JSONP(o,i,s,r)}});var J=W.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",returnM:"returnM",transform:"datumTransformation",token:"token"},path:"query",params:{returnGeometry:!0,where:"1=1",outSR:4326,outFields:"*"},within:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelContains",this},intersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIntersects",this},contains:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelWithin",this},crosses:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelCrosses",this},touches:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelTouches",this},overlaps:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelOverlaps",this},bboxIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelEnvelopeIntersects",this},indexIntersects:function(t){return this._setGeometryParams(t),this.params.spatialRel="esriSpatialRelIndexIntersects",this},nearby:function(t,e){return t=g.latLng(t),this.params.geometry=[t.lng,t.lat],this.params.geometryType="esriGeometryPoint",this.params.spatialRel="esriSpatialRelIntersects",this.params.units="esriSRUnit_Meter",this.params.distance=e,this.params.inSR=4326,this},where:function(t){return this.params.where=t,this},between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},orderBy:function(t,e){return e=e||"ASC",this.params.orderByFields=this.params.orderByFields?this.params.orderByFields+",":"",this.params.orderByFields+=[t,e].join(" "),this},run:function(i,s){return this._cleanParams(),this.options.isModern||G(this.options.url)&&void 0===this.options.isModern?(this.params.f="geojson",this.request(function(t,e){this._trapSQLerrors(t),i.call(s,t,e,e)},this)):this.request(function(t,e){this._trapSQLerrors(t),i.call(s,t,e&&k(e),e)},this)},count:function(i,t){return this._cleanParams(),this.params.returnCountOnly=!0,this.request(function(t,e){i.call(this,t,e&&e.count,e)},t)},ids:function(i,t){return this._cleanParams(),this.params.returnIdsOnly=!0,this.request(function(t,e){i.call(this,t,e&&e.objectIds,e)},t)},bounds:function(i,s){return this._cleanParams(),this.params.returnExtentOnly=!0,this.request(function(t,e){e&&e.extent&&w(e.extent)?i.call(s,t,w(e.extent),e):(t={message:"Invalid Bounds"},i.call(s,t,null,e))},s)},distinct:function(){return this.params.returnGeometry=!1,this.params.returnDistinctValues=!0,this},pixelSize:function(t){var e=g.point(t);return this.params.pixelSize=[e.x,e.y],this},layer:function(t){return this.path=t+"/query",this},_trapSQLerrors:function(t){t&&"400"===t.code&&m("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")},_cleanParams:function(){delete this.params.returnIdsOnly,delete this.params.returnExtentOnly,delete this.params.returnCountOnly},_setGeometryParams:function(t){this.params.inSR=4326;var e=z(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});function V(t){return new J(t)}var Q=W.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:!0,returnGeometry:!0,returnZ:!0,returnM:!1},layerDefs:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(i,s){return this.request(function(t,e){i.call(s,t,e&&k(e),e)},s)}});function K(t){return new Q(t)}var H=W.extend({path:"identify",between:function(t,e){return this.params.time=[t.valueOf(),e.valueOf()],this}});var X=H.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:!0},on:function(t){var e=R(t.getBounds()),i=t.getSize();return this.params.imageDisplay=[i.x,i.y,96],this.params.mapExtent=[e.xmin,e.ymin,e.xmax,e.ymax],this},at:function(t){return 2===t.length&&(t=g.latLng(t)),this._setGeometryParams(t),this},layerDef:function(t,e){return this.params.layerDefs=this.params.layerDefs?this.params.layerDefs+";":"",this.params.layerDefs+=[t,e].join(":"),this},simplify:function(t,e){var i=Math.abs(t.getBounds().getWest()-t.getBounds().getEast());return this.params.maxAllowableOffset=i/t.getSize().y*e,this},run:function(r,o){return this.request(function(t,e){if(t)r.call(o,t,void 0,e);else{var i=k(e);e.results=e.results.reverse();for(var s=0;s<i.features.length;s++){i.features[s].layerId=e.results[s].layerId}r.call(o,void 0,i,e)}})},_setGeometryParams:function(t){var e=z(t);this.params.geometry=e.geometry,this.params.geometryType=e.geometryType}});function Y(t){return new X(t)}var $=H.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:!1},at:function(t){return t=g.latLng(t),this.params.geometry=JSON.stringify({x:t.lng,y:t.lat,spatialReference:{wkid:4326}}),this.params.geometryType="esriGeometryPoint",this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(i,s){return this.request(function(t,e){i.call(s,t,e&&this._responseToGeoJSON(e),e)},this)},_responseToGeoJSON:function(t){var e=t.location,i=t.catalogItems,s=t.catalogItemVisibilities,r={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[e.x,e.y]},crs:{type:"EPSG",properties:{code:e.spatialReference.wkid}},properties:{OBJECTID:t.objectId,name:t.name,value:t.value},id:t.objectId}};if(t.properties&&t.properties.Values&&(r.pixel.properties.values=t.properties.Values),i&&i.features&&(r.catalogItems=k(i),s&&s.length===r.catalogItems.features.length))for(var o=s.length-1;0<=o;o--)r.catalogItems.features[o].properties.catalogItemVisibility=s[o];return r}});function tt(t){return new $(t)}var et=g.Evented.extend({options:{proxy:!1,useCors:i,timeout:0},initialize:function(t){t=t||{},this._requestQueue=[],this._authenticating=!1,g.Util.setOptions(this,t),this.options.url=M(this.options.url)},get:function(t,e,i,s){return this._request("get",t,e,i,s)},post:function(t,e,i,s){return this._request("post",t,e,i,s)},request:function(t,e,i,s){return this._request("request",t,e,i,s)},metadata:function(t,e){return this._request("get","",{},t,e)},authenticate:function(t){return this._authenticating=!1,this.options.token=t,this._runQueue(),this},getTimeout:function(){return this.options.timeout},setTimeout:function(t){this.options.timeout=t},_request:function(t,e,i,s,r){this.fire("requeststart",{url:this.options.url+e,params:i,method:t},!0);var o=this._createServiceCallback(t,e,i,s,r);if(this.options.token&&(i.token=this.options.token),this.options.requestParams&&g.Util.extend(i,this.options.requestParams),!this._authenticating){var n=this.options.proxy?this.options.proxy+"?"+this.options.url+e:this.options.url+e;return"get"!==t&&"request"!==t||this.options.useCors?S[t](n,i,o,r):S.get.JSONP(n,i,o,r)}this._requestQueue.push([t,e,i,s,r])},_createServiceCallback:function(i,s,r,o,n){return g.Util.bind(function(t,e){!t||499!==t.code&&498!==t.code||(this._authenticating=!0,this._requestQueue.push([i,s,r,o,n]),this.fire("authenticationrequired",{authenticate:g.Util.bind(this.authenticate,this)},!0),t.authenticate=g.Util.bind(this.authenticate,this)),o.call(n,t,e),t?this.fire("requesterror",{url:this.options.url+s,params:r,message:t.message,code:t.code,method:i},!0):this.fire("requestsuccess",{url:this.options.url+s,params:r,response:e,method:i},!0),this.fire("requestend",{url:this.options.url+s,params:r,method:i},!0)},this)},_runQueue:function(){for(var t=this._requestQueue.length-1;0<=t;t--){var e=this._requestQueue[t];this[e.shift()].apply(this,e)}this._requestQueue=[]}});var it=et.extend({identify:function(){return Y(this)},find:function(){return K(this)},query:function(){return V(this)}});function st(t){return new it(t)}var rt=et.extend({query:function(){return V(this)},identify:function(){return tt(this)}});function ot(t){return new rt(t)}var nt=et.extend({options:{idAttribute:"OBJECTID"},query:function(){return V(this)},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(t,s,r){for(var e=t.features?t.features:[t],i=e.length-1;0<=i;i--)delete e[i].id;return t=T(t),t=1<e.length?t:[t],this.post("addFeatures",{features:t},function(t,e){var i=e&&e.addResults?1<e.addResults.length?e.addResults:e.addResults[0]:void 0;s&&s.call(r,t||e.addResults[0].error,i)},r)},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,s,r){var e=t.features?t.features:[t];return t=T(t,this.options.idAttribute),t=1<e.length?t:[t],this.post("updateFeatures",{features:t},function(t,e){var i=e&&e.updateResults?1<e.updateResults.length?e.updateResults:e.updateResults[0]:void 0;s&&s.call(r,t||e.updateResults[0].error,i)},r)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,s,r){return this.post("deleteFeatures",{objectIds:t},function(t,e){var i=e&&e.deleteResults?1<e.deleteResults.length?e.deleteResults:e.deleteResults[0]:void 0;s&&s.call(r,t||e.deleteResults[0].error,i)},r)}});function at(t){return new nt(t)}var lt="https:"!==window.location.protocol?"http:":"https:",ut=g.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:lt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},NationalGeographic:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},GrayLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}},ImageryLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},ShadedRelief:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:s?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:lt+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}},ImageryClarity:{urlTemplate:lt+"//clarity.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community"}},Physical:{urlTemplate:lt+"//{s}.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:8,subdomains:["server","services"],attribution:"U.S. National Park Service"}},ImageryFirefly:{urlTemplate:lt+"//fly.maptiles.arcgis.com/arcgis/rest/services/World_Imagery_Firefly/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,attribution:"Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community",attributionUrl:"https://static.arcgis.com/attribution/World_Imagery"}}}},initialize:function(t,e){var i;if("object"==typeof t&&t.urlTemplate&&t.options)i=t;else{if("string"!=typeof t||!ut.TILES[t])throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Physical", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ImageryClarity", "ImageryFirefly", ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"');i=ut.TILES[t]}var s=g.Util.extend(i.options,e);g.Util.setOptions(this,s),this.options.ignoreDeprecationWarning||console.warn("WARNING: L.esri.BasemapLayer uses data services that are in mature support and are not being updated. Please use L.esri.Vector.vectorBasemapLayer instead. More info: https://esriurl.com/esri-leaflet-basemap"),this.options.token&&-1===i.urlTemplate.indexOf("token=")&&(i.urlTemplate+="?token="+this.options.token),this.options.proxy&&(i.urlTemplate=this.options.proxy+"?"+i.urlTemplate),g.TileLayer.prototype.initialize.call(this,i.urlTemplate,s)},onAdd:function(t){E(t),"esri-labels"===this.options.pane&&this._initPane(),this.options.attributionUrl&&Z((this.options.proxy?this.options.proxy+"?":"")+this.options.attributionUrl,t),t.on("moveend",N),g.TileLayer.prototype.onAdd.call(this,t)},onRemove:function(t){B(t),t.off("moveend",N),g.TileLayer.prototype.onRemove.call(this,t)},_initPane:function(){var t;this._map.getPane(this.options.pane)||((t=this._map.createPane(this.options.pane)).style.pointerEvents="none",t.style.zIndex=500)},getAttribution:function(){var t;return this.options.attribution&&(t='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>"),t}});var ht=g.TileLayer.extend({options:{zoomOffsetAllowance:.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{0:156543.033928,1:78271.5169639999,2:39135.7584820001,3:19567.8792409999,4:9783.93962049996,5:4891.96981024998,6:2445.98490512499,7:1222.99245256249,8:611.49622628138,9:305.748113140558,10:152.874056570411,11:76.4370282850732,12:38.2185141425366,13:19.1092570712683,14:9.55462853563415,15:4.77731426794937,16:2.38865713397468,17:1.19432856685505,18:.597164283559817,19:.298582141647617,20:.14929107082381,21:.07464553541191,22:.0373227677059525,23:.0186613838529763}},initialize:function(t){t=U(t=g.Util.setOptions(this,t)),this.tileUrl=(t.proxy?t.proxy+"?":"")+t.url+"tile/{z}/{y}/{x}"+(t.requestParams&&0<Object.keys(t.requestParams).length?g.Util.getParamString(t.requestParams):""),-1!==t.url.indexOf("{s}")&&t.subdomains&&(t.url=t.url.replace("{s}",t.subdomains[0])),this.service=st(t),this.service.addEventParent(this),new RegExp(/tiles.arcgis(online)?\.com/g).test(t.url)&&(this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}"),t.subdomains=["1","2","3","4"]),this.options.token&&(this.tileUrl+="?token="+this.options.token),g.TileLayer.prototype.initialize.call(this,this.tileUrl,t)},getTileUrl:function(t){var e=this._getZoomForUrl();return g.Util.template(this.tileUrl,g.Util.extend({s:this._getSubdomain(t),x:t.x,y:t.y,z:this._lodMap&&this._lodMap[e]?this._lodMap[e]:e},this.options))},createTile:function(t,e){var i=document.createElement("img");return g.DomEvent.on(i,"load",g.Util.bind(this._tileOnLoad,this,e,i)),g.DomEvent.on(i,"error",g.Util.bind(this._tileOnError,this,e,i)),this.options.crossOrigin&&(i.crossOrigin=""),i.alt="",!this._lodMap||this._lodMap&&this._lodMap[this._getZoomForUrl()]?i.src=this.getTileUrl(t):this.once("lodmap",function(){i.src=this.getTileUrl(t)},this),i},onAdd:function(u){E(u),this._lodMap||this.metadata(function(t,e){if(!t&&e.spatialReference){var i=e.spatialReference.latestWkid||e.spatialReference.wkid;if(!this.options.attribution&&u.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,u.attributionControl.addAttribution(this.getAttribution())),u.options.crs!==g.CRS.EPSG3857||102100!==i&&3857!==i)u.options.crs&&u.options.crs.code&&-1<u.options.crs.code.indexOf(i)||m("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html");else{this._lodMap={};for(var s=e.tileInfo.lods,r=ht.MercatorZoomLevels,o=0;o<s.length;o++){var n=s[o];for(var a in r){var l=r[a];if(this._withinPercentage(n.resolution,l,this.options.zoomOffsetAllowance)){this._lodMap[a]=n.level;break}}}this.fire("lodmap")}}},this),g.TileLayer.prototype.onAdd.call(this,u)},onRemove:function(t){B(t),g.TileLayer.prototype.onRemove.call(this,t)},metadata:function(t,e){return this.service.metadata(t,e),this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(t){var e="?token="+t;return this.tileUrl=this.options.token?this.tileUrl.replace(/\?token=(.+)/g,e):this.tileUrl+e,this.options.token=t,this.service.authenticate(t),this},_withinPercentage:function(t,e,i){return Math.abs(t/e-1)<i}});var ct=g.ImageOverlay.extend({onAdd:function(t){this._topLeft=t.getPixelBounds().min,g.ImageOverlay.prototype.onAdd.call(this,t)},_reset:function(){this._map.options.crs===g.CRS.EPSG3857?g.ImageOverlay.prototype._reset.call(this):g.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}),pt=g.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:i,attribution:null,interactive:!1,alt:""},onAdd:function(i){E(i),this.options.zIndex&&(this.options.position=null),this._update=g.Util.throttle(this._update,this.options.updateInterval,this),i.on("moveend",this._update,this),this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())?i.addLayer(this._currentImage):this._currentImage&&(this._map.removeLayer(this._currentImage),this._currentImage=null),this._update(),this._popup&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this.metadata(function(t,e){!t&&!this.options.attribution&&i.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,i.attributionControl.addAttribution(this.getAttribution()))},this)},onRemove:function(t){B(t),this._currentImage&&this._map.removeLayer(this._currentImage),this._popup&&(this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._map.off("moveend",this._update,this)},bindPopup:function(t,e){return this._shouldRenderPopup=!1,this._lastClick=!1,this._popup=g.popup(e),this._popupFunction=t,this._map&&(this._map.on("click",this._getPopupData,this),this._map.on("dblclick",this._resetPopupState,this)),this},unbindPopup:function(){return this._map&&(this._map.closePopup(this._popup),this._map.off("click",this._getPopupData,this),this._map.off("dblclick",this._resetPopupState,this)),this._popup=!1,this},bringToFront:function(){return this.options.position="front",this._currentImage&&(this._currentImage.bringToFront(),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this.options.position="back",this._currentImage&&(this._currentImage.bringToBack(),this._setAutoZIndex(Math.min)),this},setZIndex:function(t){return this.options.zIndex=t,this._currentImage&&this._currentImage.setZIndex(t),this},_setAutoZIndex:function(t){if(this._currentImage){for(var e,i=this._currentImage.getPane().children,s=-t(-1/0,1/0),r=0,o=i.length;r<o;r++)e=i[r].style.zIndex,i[r]!==this._currentImage._image&&e&&(s=t(s,+e));isFinite(s)&&(this.options.zIndex=s+t(-1,1),this.setZIndex(this.options.zIndex))}},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(t){return this.options.opacity=t,this._currentImage&&this._currentImage.setOpacity(t),this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(t,e){return this.options.from=t,this.options.to=e,this._update(),this},metadata:function(t,e){return this.service.metadata(t,e),this},authenticate:function(t){return this.service.authenticate(t),this},redraw:function(){this._update()},_renderImage:function(t,s,e){if(this._map){if(e&&(t="data:"+e+";base64,"+t),!t)return;var r=new ct(t,s,{opacity:0,crossOrigin:this.options.withCredentials?"use-credentials":this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map),o=function(t){var e,i;r.off("error",o,this),this._map&&(e=t.target,i=this._currentImage,e._bounds.equals(s)&&e._bounds.equals(this._map.getBounds())?(this._currentImage=e,"front"===this.options.position?this.bringToFront():"back"===this.options.position&&this.bringToBack(),this.options.zIndex&&this.setZIndex(this.options.zIndex),this._map&&this._currentImage._map?this._currentImage.setOpacity(this.options.opacity):this._currentImage._map.removeLayer(this._currentImage),i&&this._map&&this._map.removeLayer(i),i&&i._map&&i._map.removeLayer(i)):this._map.removeLayer(e)),this.fire("load",{bounds:s})};r.once("error",function(){this._map.removeLayer(r),this.fire("error"),r.off("load",o,this)},this),r.once("load",o,this)}},_update:function(){var t,e,i;this._map&&(t=this._map.getZoom(),e=this._map.getBounds(),this._animatingZoom||this._map._panTransition&&this._map._panTransition._inProgress||(t>this.options.maxZoom||t<this.options.minZoom?this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null):(i=this._buildExportParams(),g.Util.extend(i,this.options.requestParams),i?(this._requestExport(i,e),this.fire("loading",{bounds:e})):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null))))},_renderPopup:function(t,e,i,s){var r;t=g.latLng(t),this._shouldRenderPopup&&this._lastClick.equals(t)&&((r=this._popupFunction(e,i,s))&&this._popup.setLatLng(t).setContent(r).openOn(this._map))},_resetPopupState:function(t){this._shouldRenderPopup=!1,this._lastClick=t.latlng},_calculateBbox:function(){var t=this._map.getPixelBounds(),e=this._map.unproject(t.getBottomLeft()),i=this._map.unproject(t.getTopRight()),s=this._map.options.crs.project(i),r=this._map.options.crs.project(e),o=g.bounds(s,r);return[o.getBottomLeft().x,o.getBottomLeft().y,o.getTopRight().x,o.getTopRight().y].join(",")},_calculateImageSize:function(){var t=this._map.getPixelBounds(),e=this._map.getSize(),i=this._map.unproject(t.getBottomLeft()),s=this._map.unproject(t.getTopRight()),r=this._map.latLngToLayerPoint(s).y,o=this._map.latLngToLayerPoint(i).y;return(0<r||o<e.y)&&(e.y=o-r),e.x+","+e.y}}),dt=pt.extend({options:{updateInterval:150,format:"jpgpng",transparent:!0,f:"image"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(t){t=U(t),this.service=ot(t),this.service.addEventParent(this),g.Util.setOptions(this,t)},setPixelType:function(t){return this.options.pixelType=t,this._update(),this},getPixelType:function(){return this.options.pixelType},setBandIds:function(t){return g.Util.isArray(t)?this.options.bandIds=t.join(","):this.options.bandIds=t.toString(),this._update(),this},getBandIds:function(){return this.options.bandIds},setNoData:function(t,e){return g.Util.isArray(t)?this.options.noData=t.join(","):this.options.noData=t.toString(),e&&(this.options.noDataInterpretation=e),this._update(),this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(t){this.options.renderingRule=t,this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(t){this.options.mosaicRule=t,this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(s){var t=g.Util.bind(function(t,e,i){t||setTimeout(g.Util.bind(function(){this._renderPopup(s.latlng,t,e,i)},this),300)},this),e=this.identify().at(s.latlng);this.options.mosaicRule&&e.setMosaicRule(this.options.mosaicRule),e.run(t),this._shouldRenderPopup=!0,this._lastClick=s.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={bbox:this._calculateBbox(),size:this._calculateImageSize(),format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};return this.options.from&&this.options.to&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.options.pixelType&&(e.pixelType=this.options.pixelType),this.options.interpolation&&(e.interpolation=this.options.interpolation),this.options.compressionQuality&&(e.compressionQuality=this.options.compressionQuality),this.options.bandIds&&(e.bandIds=this.options.bandIds),0!==this.options.noData&&!this.options.noData||(e.noData=this.options.noData),this.options.noDataInterpretation&&(e.noDataInterpretation=this.options.noDataInterpretation),this.service.options.token&&(e.token=this.service.options.token),this.options.renderingRule&&(e.renderingRule=JSON.stringify(this.options.renderingRule)),this.options.mosaicRule&&(e.mosaicRule=JSON.stringify(this.options.mosaicRule)),e},_requestExport:function(t,i){var e;"json"===this.options.f?this.service.request("exportImage",t,function(t,e){t||(this.options.token&&(e.href+="?token="+this.options.token),this.options.proxy&&(e.href=this.options.proxy+"?"+e.href),this._renderImage(e.href,i))},this):(t.f="image",e=this.options.url+"exportImage"+g.Util.getParamString(t),this.options.proxy&&(e=this.options.proxy+"?"+e),this._renderImage(e,i))}});var mt=pt.extend({options:{updateInterval:150,layers:!1,layerDefs:!1,timeOptions:!1,format:"png32",transparent:!0,f:"json"},initialize:function(t){t=U(t),this.service=st(t),this.service.addEventParent(this),g.Util.setOptions(this,t)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(t){return this.options.dynamicLayers=t,this._update(),this},getLayers:function(){return this.options.layers},setLayers:function(t){return this.options.layers=t,this._update(),this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(t){return this.options.layerDefs=t,this._update(),this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(t){return this.options.timeOptions=t,this._update(),this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(s){var t=g.Util.bind(function(t,e,i){t||setTimeout(g.Util.bind(function(){this._renderPopup(s.latlng,t,e,i)},this),300)},this),e=this.options.popup?this.options.popup.on(this._map).at(s.latlng):this.identify().on(this._map).at(s.latlng);if(e.params.maxAllowableOffset||e.simplify(this._map,.5),this.options.popup&&this.options.popup.params&&this.options.popup.params.layers||(this.options.layers?e.layers("visible:"+this.options.layers.join(",")):e.layers("visible")),this.options.layerDefs&&"string"!=typeof this.options.layerDefs&&!e.params.layerDefs)for(var i in this.options.layerDefs)this.options.layerDefs.hasOwnProperty(i)&&e.layerDef(i,this.options.layerDefs[i]);e.run(t),this._shouldRenderPopup=!0,this._lastClick=s.latlng},_buildExportParams:function(){var t=parseInt(this._map.options.crs.code.split(":")[1],10),e={bbox:this._calculateBbox(),size:this._calculateImageSize(),dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:t,imageSR:t};if(this.options.dynamicLayers&&(e.dynamicLayers=this.options.dynamicLayers),this.options.layers){if(0===this.options.layers.length)return;e.layers="show:"+this.options.layers.join(",")}return this.options.layerDefs&&(e.layerDefs="string"==typeof this.options.layerDefs?this.options.layerDefs:JSON.stringify(this.options.layerDefs)),this.options.timeOptions&&(e.timeOptions=JSON.stringify(this.options.timeOptions)),this.options.from&&this.options.to&&(e.time=this.options.from.valueOf()+","+this.options.to.valueOf()),this.service.options.token&&(e.token=this.service.options.token),this.options.proxy&&(e.proxy=this.options.proxy),this.options.disableCache&&(e._ts=Date.now()),e},_requestExport:function(t,i){var e;"json"===this.options.f?this.service.request("export",t,function(t,e){t||(this.options.token&&e.href&&(e.href+="?token="+this.options.token),this.options.proxy&&e.href&&(e.href=this.options.proxy+"?"+e.href),e.href?this._renderImage(e.href,i):this._renderImage(e.imageData,i,e.contentType))},this):(t.f="image",e=this.options.url+"export"+g.Util.getParamString(t),this.options.proxy&&(e=this.options.proxy+"?"+e),this._renderImage(e,i))}});var ft=g.Layer.extend({options:{cellSize:512,updateWhenIdle:g.Browser.mobile,updateInterval:150,noWrap:!1,keepBuffer:1.5},initialize:function(t){g.Util.setOptions(this,t)},onAdd:function(t){this._cells={},this._activeCells={},this._resetView(),this._update()},onRemove:function(t){this._removeAllCells(),this._cellZoom=void 0},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllCells(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=g.Util.throttle(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),t},createCell:function(){return document.createElement("div")},removeCell:function(){},reuseCell:function(){},cellLeave:function(){},cellEnter:function(){},getCellSize:function(){var t=this.options.cellSize;return t instanceof g.Point?t:new g.Point(t,t)},_pruneCells:function(){if(this._map){var t,e,i;for(t in this._cells)(i=this._cells[t]).retain=i.current;for(t in this._cells){(i=this._cells[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2))}for(t in this._cells)this._cells[t].retain||this._removeCell(t)}},_removeAllCells:function(){for(var t in this._cells)this._removeCell(t)},_invalidateAll:function(){this._removeAllCells(),this._cellZoom=void 0},_retainParent:function(t,e,i,s){var r=Math.floor(t/2),o=Math.floor(e/2),n=i-1,a=new g.Point(+r,+o);a.z=+n;var l=this._cellCoordsToKey(a),u=this._cells[l];return u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),s<n&&this._retainParent(r,o,n,s))},_retainChildren:function(t,e,i,s){for(var r=2*t;r<2*t+2;r++)for(var o=2*e;o<2*e+2;o++){var n=new g.Point(r,o);n.z=i+1;var a=this._cellCoordsToKey(n),l=this._cells[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<s&&this._retainChildren(r,o,i+1,s))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);e||this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_setView:function(t,e,i,s){var r=Math.round(e);s||(this._cellZoom=r,this._abortLoading&&this._abortLoading(),this._resetGrid(),void 0!==r&&this._update(t),i||this._pruneCells(),this._noPrune=!!i)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._cellSize=this.getCellSize(),s=this._cellZoom,r=this._map.getPixelWorldBounds(this._cellZoom);r&&(this._globalCellRange=this._pxBoundsToCellRange(r)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],s).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],s).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],s).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],s).y/i.y)]},_onMoveEnd:function(t){t&&(t.pinch||t.flyTo)||!this._map||this._map._animatingZoom||this._update()},_getCelldPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),s=e.getZoomScale(i,this._cellZoom),r=e.project(t,this._cellZoom).floor(),o=e.getSize().divideBy(2*s);return new g.Bounds(r.subtract(o),r.add(o))},_update:function(t){var e=this._map;if(e){var i=Math.round(e.getZoom());void 0===t&&(t=e.getCenter());var s=this._getCelldPixelBounds(t),r=this._pxBoundsToCellRange(s),o=r.getCenter(),n=[],a=this.options.keepBuffer,l=new g.Bounds(r.getBottomLeft().subtract([a,-a]),r.getTopRight().add([a,-a]));if(!(isFinite(r.min.x)&&isFinite(r.min.y)&&isFinite(r.max.x)&&isFinite(r.max.y)))throw new Error("Attempted to load an infinite number of cells");for(var u in this._cells){var h=this._cells[u].coords;h.z===this._cellZoom&&l.contains(new g.Point(h.x,h.y))||(this._cells[u].current=!1)}if(1<Math.abs(i-this._cellZoom))this._setView(t,i);else{for(var c=r.min.y;c<=r.max.y;c++)for(var p=r.min.x;p<=r.max.x;p++){var d,m=new g.Point(p,c);m.z=this._cellZoom,this._isValidCell(m)&&((d=this._cells[this._cellCoordsToKey(m)])?d.current=!0:n.push(m))}if(n.sort(function(t,e){return t.distanceTo(o)-e.distanceTo(o)}),0!==n.length)for(this._loading||(this._loading=!0),p=0;p<n.length;p++){var f=this._cellCoordsToKey(n[p]),y=this._keyToCellCoords(f);this._activeCells[y]?this._reuseCell(n[p]):this._createCell(n[p])}}}},_isValidCell:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalCellRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var s=this._cellCoordsToBounds(t);return g.toLatLngBounds(this.options.bounds).overlaps(s)},_keyToBounds:function(t){return this._cellCoordsToBounds(this._keyToCellCoords(t))},_cellCoordsToNwSe:function(t){var e=this._map,i=this.getCellSize(),s=t.scaleBy(i),r=s.add(i);return[e.unproject(s,t.z),e.unproject(r,t.z)]},_cellCoordsToBounds:function(t){var e=this._cellCoordsToNwSe(t),i=new g.LatLngBounds(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_cellCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToCellCoords:function(t){var e=t.split(":"),i=new g.Point(+e[0],+e[1]);return i.z=+e[2],i},_removeCell:function(t){var e,i,s,r=this._cells[t];r&&(e=this._keyToCellCoords(t),i=this._wrapCoords(e),s=this._cellCoordsToBounds(this._wrapCoords(e)),r.current=!1,delete this._cells[t],this._activeCells[t]=r,this.cellLeave(s,i,t),this.fire("cellleave",{key:t,coords:i,bounds:s}))},_reuseCell:function(t){var e=this._cellCoordsToKey(t);this._cells[e]=this._activeCells[e],this._cells[e].current=!0;var i=this._wrapCoords(t),s=this._cellCoordsToBounds(this._wrapCoords(t));this.cellEnter(s,i,e),this.fire("cellenter",{key:e,coords:i,bounds:s})},_createCell:function(t){var e=this._cellCoordsToKey(t),i=this._wrapCoords(t),s=this._cellCoordsToBounds(this._wrapCoords(t));this.createCell(s,i,e),this.fire("cellcreate",{key:e,coords:i,bounds:s}),this._cells[e]={coords:t,current:!0},g.Util.requestAnimFrame(this._pruneCells,this)},_cellReady:function(t,e,i){var s=this._cellCoordsToKey(t);(i=this._cells[s])&&(i.loaded=+new Date,i.active=!0)},_getCellPos:function(t){return t.scaleBy(this.getCellSize())},_wrapCoords:function(t){var e=new g.Point(this._wrapX?g.Util.wrapNum(t.x,this._wrapX):t.x,this._wrapY?g.Util.wrapNum(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToCellRange:function(t){var e=this.getCellSize();return new g.Bounds(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}});function yt(t){this.values=[].concat(t||[])}yt.prototype.query=function(t){var e=this.getIndex(t);return this.values[e]},yt.prototype.getIndex=function(t){this.dirty&&this.sort();for(var e,i,s=0,r=this.values.length-1;s<=r;)if(e=(s+r)/2|0,+(i=this.values[Math.round(e)]).value<+t)s=1+e;else{if(!(+i.value>+t))return e;r=e-1}return Math.abs(~r)},yt.prototype.between=function(t,e){var i=this.getIndex(t),s=this.getIndex(e);if(0===i&&0===s)return[];for(;this.values[i-1]&&this.values[i-1].value===t;)i--;for(;this.values[s+1]&&this.values[s+1].value===e;)s++;return this.values[s]&&this.values[s].value===e&&this.values[s+1]&&s++,this.values.slice(i,s)},yt.prototype.insert=function(t){return this.values.splice(this.getIndex(t.value),0,t),this},yt.prototype.bulkAdd=function(t,e){return this.values=this.values.concat([].concat(t||[])),e?this.sort():this.dirty=!0,this},yt.prototype.sort=function(){return this.values.sort(function(t,e){return e.value-t.value}).reverse(),this.dirty=!1,this};var gt=ft.extend({options:{attribution:null,where:"1=1",fields:["*"],from:!1,to:!1,timeField:!1,timeFilterMode:"server",simplifyFactor:0,precision:6,fetchAllFeatures:!1},initialize:function(t){if(ft.prototype.initialize.call(this,t),t=U(t),t=g.Util.setOptions(this,t),this.service=at(t),this.service.addEventParent(this),"*"!==this.options.fields[0]){for(var e=!1,i=0;i<this.options.fields.length;i++)this.options.fields[i].match(/^(OBJECTID|FID|OID|ID)$/i)&&(e=!0);!1===e&&m("no known esriFieldTypeOID field detected in fields Array. Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}this.options.timeField.start&&this.options.timeField.end?(this._startTimeIndex=new yt,this._endTimeIndex=new yt):this.options.timeField&&(this._timeIndex=new yt),this._cache={},this._currentSnapshot=[],this._activeRequests=0},onAdd:function(r){return E(r),this.service.metadata(function(t,e){var i,s;t||(i=e.supportedQueryFormats,(s=!1)!==this.service.options.isModern&&!this.options.fetchAllFeatures||(s=!0),!s&&i&&-1!==i.indexOf("geoJSON")&&(this.service.options.isModern=!0),e.objectIdField&&(this.service.options.idAttribute=e.objectIdField),!this.options.attribution&&r.attributionControl&&e.copyrightText&&(this.options.attribution=e.copyrightText,r.attributionControl.addAttribution(this.getAttribution())))},this),r.on("zoomend",this._handleZoomChange,this),ft.prototype.onAdd.call(this,r)},onRemove:function(t){return B(t),t.off("zoomend",this._handleZoomChange,this),ft.prototype.onRemove.call(this,t)},getAttribution:function(){return this.options.attribution},createCell:function(t,e){this._visibleZoom()&&this._requestFeatures(t,e)},_requestFeatures:function(s,r,o,n){this._activeRequests++,n=n||0;var a=this.options.where;return 1===this._activeRequests&&this.fire("loading",{bounds:s},!0),this._buildQuery(s,n).run(function(t,e,i){i&&i.exceededTransferLimit&&this.fire("drawlimitexceeded"),this.options.where===a&&(!t&&e&&e.features.length&&g.Util.requestAnimFrame(g.Util.bind(function(){this._addFeatures(e.features,r),this._postProcessFeatures(s)},this)),t||!e||e.features.length||this._postProcessFeatures(s),t&&this._postProcessFeatures(s),o&&o.call(this,t,e),i&&(i.exceededTransferLimit||i.properties&&i.properties.exceededTransferLimit)&&this.options.fetchAllFeatures&&this._requestFeatures(s,r,o,n+e.features.length))},this)},_postProcessFeatures:function(t){this._activeRequests--,this._activeRequests<=0&&this.fire("load",{bounds:t})},_cacheKey:function(t){return t.z+":"+t.x+":"+t.y},_addFeatures:function(t,e){var i;e&&(i=this._cacheKey(e),this._cache[i]=this._cache[i]||[]);for(var s=t.length-1;0<=s;s--){var r=t[s].id;-1===this._currentSnapshot.indexOf(r)&&this._currentSnapshot.push(r),void 0!==i&&-1===this._cache[i].indexOf(r)&&this._cache[i].push(r)}this.options.timeField&&this._buildTimeIndexes(t),this.createLayers(t)},_buildQuery:function(t,e){var i=this.service.query().intersects(t).where(this.options.where).fields(this.options.fields).precision(this.options.precision);return this.options.fetchAllFeatures&&!isNaN(parseInt(e))&&(i=i.offset(e)),i.params.resultType="tile",this.options.requestParams&&g.Util.extend(i.params,this.options.requestParams),this.options.simplifyFactor&&i.simplify(this._map,this.options.simplifyFactor),"server"===this.options.timeFilterMode&&this.options.from&&this.options.to&&i.between(this.options.from,this.options.to),i},setWhere:function(s,r,o){this.options.where=s&&s.length?s:"1=1";for(var n=[],a=[],l=0,u=null,t=g.Util.bind(function(t,e){if(t&&(u=t),e)for(var i=e.features.length-1;0<=i;i--)a.push(e.features[i].id);--l<=0&&this._visibleZoom()&&s===this.options.where&&(this._currentSnapshot=a,g.Util.requestAnimFrame(g.Util.bind(function(){this.removeLayers(n),this.addLayers(a),r&&r.call(o,u)},this)))},this),e=this._currentSnapshot.length-1;0<=e;e--)n.push(this._currentSnapshot[e]);for(var i in this._cache={},this._cells){l++;var h=this._keyToCellCoords(i),c=this._cellCoordsToBounds(h);this._requestFeatures(c,h,t)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(e,i,s,r){var o=this.options.from,n=this.options.to,a=0,l=null,t=g.Util.bind(function(t){t&&(l=t),this._filterExistingFeatures(o,n,e,i),a--,s&&a<=0&&s.call(r,l)},this);if(this.options.from=e,this.options.to=i,this._filterExistingFeatures(o,n,e,i),"server"===this.options.timeFilterMode)for(var u in this._cells){a++;var h=this._keyToCellCoords(u),c=this._cellCoordsToBounds(h);this._requestFeatures(c,h,t)}return this},refresh:function(){this.setWhere(this.options.where)},_filterExistingFeatures:function(t,e,i,s){var r=t&&e?this._getFeaturesInTimeRange(t,e):this._currentSnapshot,o=this._getFeaturesInTimeRange(i,s);if(o.indexOf)for(var n=0;n<o.length;n++){var a=r.indexOf(o[n]);0<=a&&r.splice(a,1)}g.Util.requestAnimFrame(g.Util.bind(function(){this.removeLayers(r),this.addLayers(o)},this))},_getFeaturesInTimeRange:function(t,e){var i=[];if(this.options.timeField.start&&this.options.timeField.end)var s=this._startTimeIndex.between(t,e),r=this._endTimeIndex.between(t,e),o=s.concat(r);else{if(!this._timeIndex)return m("You must set timeField in the layer constructor in order to manipulate the start and end time filter."),[];o=this._timeIndex.between(t,e)}for(var n=o.length-1;0<=n;n--)i.push(o[n].id);return i},_buildTimeIndexes:function(t){var e;if(this.options.timeField.start&&this.options.timeField.end){for(var i=[],s=[],r=t.length-1;0<=r;r--)e=t[r],i.push({id:e.id,value:new Date(e.properties[this.options.timeField.start])}),s.push({id:e.id,value:new Date(e.properties[this.options.timeField.end])});this._startTimeIndex.bulkAdd(i),this._endTimeIndex.bulkAdd(s)}else{var o=[];for(r=t.length-1;0<=r;r--)e=t[r],o.push({id:e.id,value:new Date(e.properties[this.options.timeField])});this._timeIndex.bulkAdd(o)}},_featureWithinTimeRange:function(t){if(!this.options.from||!this.options.to)return!0;var e=+this.options.from.valueOf(),i=+this.options.to.valueOf();if("string"==typeof this.options.timeField){var s=+t.properties[this.options.timeField];return e<=s&&s<=i}if(this.options.timeField.start&&this.options.timeField.end){var r=+t.properties[this.options.timeField.start],o=+t.properties[this.options.timeField.end];return e<=r&&r<=i||e<=o&&o<=i||r<=e&&i<=o}},_visibleZoom:function(){if(!this._map)return!1;var t=this._map.getZoom();return!(t>this.options.maxZoom||t<this.options.minZoom)},_handleZoomChange:function(){if(this._visibleZoom())for(var t in this._cells){var e=this._cells[t].coords,i=this._cacheKey(e);this._cache[i]&&this.addLayers(this._cache[i])}else this.removeLayers(this._currentSnapshot),this._currentSnapshot=[]},authenticate:function(t){return this.service.authenticate(t),this},metadata:function(t,e){return this.service.metadata(t,e),this},query:function(){return this.service.query()},_getMetadata:function(i){this._metadata?i(void 0,this._metadata):this.metadata(g.Util.bind(function(t,e){this._metadata=e,i(t,this._metadata)},this))},addFeature:function(t,e,i){this.addFeatures(t,e,i)},addFeatures:function(e,o,n){this._getMetadata(g.Util.bind(function(t,s){var r;t?o&&o.call(this,t,null):(r=e.features?e.features:[e],this.service.addFeatures(e,g.Util.bind(function(t,e){if(!t){for(var i=r.length-1;0<=i;i--)r[i].properties[s.objectIdField]=1<r.length?e[i].objectId:e.objectId,r[i].id=1<r.length?e[i].objectId:e.objectId;this._addFeatures(r)}o&&o.call(n,t,e)},this)))},this))},updateFeature:function(t,e,i){this.updateFeatures(t,e,i)},updateFeatures:function(t,s,r){var o=t.features?t.features:[t];this.service.updateFeatures(t,function(t,e){if(!t){for(var i=o.length-1;0<=i;i--)this.removeLayers([o[i].id],!0);this._addFeatures(o)}s&&s.call(r,t,e)},this)},deleteFeature:function(t,e,i){this.deleteFeatures(t,e,i)},deleteFeatures:function(t,r,o){return this.service.deleteFeatures(t,function(t,e){var i=e.length?e:[e];if(!t&&0<i.length)for(var s=i.length-1;0<=s;s--)this.removeLayers([i[s].objectId],!0);r&&r.call(o,t,e)},this)}}),_t=gt.extend({options:{cacheLayers:!0},initialize:function(t){t.apikey&&(t.token=t.apikey),gt.prototype.initialize.call(this,t),this._originalStyle=this.options.style,this._layers={}},onRemove:function(t){for(var e in this._layers)t.removeLayer(this._layers[e]),this.fire("removefeature",{feature:this._layers[e].feature,permanent:!1},!0);return gt.prototype.onRemove.call(this,t)},createNewLayer:function(t){var e=g.GeoJSON.geometryToLayer(t,this.options);return e&&(e.defaultOptions=e.options),e},_updateLayer:function(t,e){var i=[],s=this.options.coordsToLatLng||g.GeoJSON.coordsToLatLng;switch(e.properties&&(t.feature.properties=e.properties),e.geometry.type){case"Point":i=g.GeoJSON.coordsToLatLng(e.geometry.coordinates),t.setLatLng(i);break;case"LineString":i=g.GeoJSON.coordsToLatLngs(e.geometry.coordinates,0,s),t.setLatLngs(i);break;case"MultiLineString":case"Polygon":i=g.GeoJSON.coordsToLatLngs(e.geometry.coordinates,1,s),t.setLatLngs(i);break;case"MultiPolygon":i=g.GeoJSON.coordsToLatLngs(e.geometry.coordinates,2,s),t.setLatLngs(i)}},createLayers:function(t){for(var e=t.length-1;0<=e;e--){var i,s=t[e],r=this._layers[s.id];!this._visibleZoom()||!r||this._map.hasLayer(r)||this.options.timeField&&!this._featureWithinTimeRange(s)||(this._map.addLayer(r),this.fire("addfeature",{feature:r.feature},!0)),r&&0<this.options.simplifyFactor&&(r.setLatLngs||r.setLatLng)&&this._updateLayer(r,s),r||((i=this.createNewLayer(s))?(i.feature=s,i.addEventParent(this),this.options.onEachFeature&&this.options.onEachFeature(i.feature,i),this._layers[i.feature.id]=i,this.setFeatureStyle(i.feature.id,this.options.style),this.fire("createfeature",{feature:i.feature},!0),this._visibleZoom()&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(s))&&this._map.addLayer(i)):m("invalid GeoJSON encountered"))}},addLayers:function(t){for(var e=t.length-1;0<=e;e--){var i=this._layers[t[e]];!i||this.options.timeField&&!this._featureWithinTimeRange(i.feature)||(this._map.addLayer(i),this.fire("addfeature",{feature:i.feature},!0))}},removeLayers:function(t,e){for(var i=t.length-1;0<=i;i--){var s=t[i],r=this._layers[s];r&&(this.fire("removefeature",{feature:r.feature,permanent:e},!0),this._map.removeLayer(r)),r&&e&&delete this._layers[s]}},cellEnter:function(t,s){this._visibleZoom()&&!this._zooming&&this._map&&g.Util.requestAnimFrame(g.Util.bind(function(){var t=this._cacheKey(s),e=this._cellCoordsToKey(s),i=this._cache[t];this._activeCells[e]&&i&&this.addLayers(i)},this))},cellLeave:function(t,a){this._zooming||g.Util.requestAnimFrame(g.Util.bind(function(){if(this._map){var t=this._cacheKey(a),e=this._cellCoordsToKey(a),i=this._cache[t],s=this._map.getBounds();if(!this._activeCells[e]&&i){for(var r=!0,o=0;o<i.length;o++){var n=this._layers[i[o]];n&&n.getBounds&&s.intersects(n.getBounds())&&(r=!1)}r&&this.removeLayers(i,!this.options.cacheLayers),!this.options.cacheLayers&&r&&(delete this._cache[t],delete this._cells[e],delete this._activeCells[e])}}},this))},resetStyle:function(){return this.options.style=this._originalStyle,this.eachFeature(function(t){this.resetFeatureStyle(t.feature.id)},this),this},setStyle:function(e){return this.options.style=e,this.eachFeature(function(t){this.setFeatureStyle(t.feature.id,e)},this),this},resetFeatureStyle:function(t){var e=this._layers[t],i=this._originalStyle||g.Path.prototype.options;return e&&(g.Util.extend(e.options,e.defaultOptions),this.setFeatureStyle(t,i)),this},setFeatureStyle:function(t,e){var i=this._layers[t];return"function"==typeof e&&(e=e(i.feature)),i.setStyle&&i.setStyle(e),this},eachActiveFeature:function(t,e){if(this._map){var i=this._map.getBounds();for(var s in this._layers)-1!==this._currentSnapshot.indexOf(this._layers[s].feature.id)&&("function"==typeof this._layers[s].getLatLng&&i.contains(this._layers[s].getLatLng())||"function"==typeof this._layers[s].getBounds&&i.intersects(this._layers[s].getBounds()))&&t.call(e,this._layers[s])}return this},eachFeature:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getFeature:function(t){return this._layers[t]},bringToBack:function(){this.eachFeature(function(t){t.bringToBack&&t.bringToBack()})},bringToFront:function(){this.eachFeature(function(t){t.bringToFront&&t.bringToFront()})},redraw:function(t){return t&&this._redraw(t),this},_redraw:function(t){var e,i,s=this._layers[t],r=s.feature;s&&s.setIcon&&this.options.pointToLayer&&this.options.pointToLayer&&(e=this.options.pointToLayer(r,g.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])).options.icon,s.setIcon(e)),s&&s.setStyle&&this.options.pointToLayer&&(i=this.options.pointToLayer(r,g.latLng(r.geometry.coordinates[1],r.geometry.coordinates[0])).options,this.setFeatureStyle(r.id,i)),s&&s.setStyle&&this.options.style&&this.resetStyle(r.id)}});var vt=e;t.BasemapLayer=ut,t.DynamicMapLayer=mt,t.FeatureLayer=_t,t.FeatureLayerService=nt,t.FeatureManager=gt,t.Find=Q,t.Identify=H,t.IdentifyFeatures=X,t.IdentifyImage=$,t.ImageMapLayer=dt,t.ImageService=rt,t.MapService=it,t.Query=J,t.RasterLayer=pt,t.Service=et,t.Support=a,t.Task=W,t.TiledMapLayer=ht,t.Util=j,t.VERSION=vt,t.basemapLayer=function(t,e){return new ut(t,e)},t.dynamicMapLayer=function(t,e){return new mt(t,e)},t.featureLayer=function(t){return new _t(t)},t.featureLayerService=at,t.find=K,t.get=d,t.identify=function(t){return new H(t)},t.identifyFeatures=Y,t.identifyImage=tt,t.imageMapLayer=function(t,e){return new dt(t,e)},t.imageService=ot,t.mapService=st,t.options=r,t.post=o,t.query=V,t.request=c,t.service=function(t){return t=U(t),new et(t)},t.task=function(t){return t=U(t),new W(t)},t.tiledMapLayer=function(t,e){return new ht(t,e)},Object.defineProperty(t,"__esModule",{value:!0})});
12
- //# sourceMappingURL=esri-leaflet.js.map