You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

149 lines
4.3 KiB

  1. <?php
  2. if (!defined('_ECRIRE_INC_VERSION')) {
  3. return;
  4. }
  5. // pour compat cf https://zone.spip.org/trac/spip-zone/changeset/79911/
  6. define('_DIR_LIB_GIS', find_in_path('lib/leaflet/'));
  7. $config = @unserialize($GLOBALS['meta']['gis']);
  8. $api_key_bing = isset($config['api_key_bing']) ? trim($config['api_key_bing']) : '';
  9. $gis_layers = array (
  10. 'openstreetmap_mapnik' => array(
  11. 'nom' => 'OpenStreetMap',
  12. 'layer' => 'L.tileLayer.provider("OpenStreetMap")'
  13. ),
  14. 'openstreetmap_de' => array(
  15. 'nom' => 'OpenStreetMap DE',
  16. 'layer' => 'L.tileLayer.provider("OpenStreetMap.DE")'
  17. ),
  18. 'openstreetmap_fr' => array(
  19. 'nom' => 'OpenStreetMap FR',
  20. 'layer' => 'L.tileLayer.provider("OpenStreetMap.France")'
  21. ),
  22. 'openstreetmap_hot' => array(
  23. 'nom' => 'OpenStreetMap H.O.T.',
  24. 'layer' => 'L.tileLayer.provider("OpenStreetMap.HOT")'
  25. ),
  26. 'opentopomap' => array(
  27. 'nom' => 'OpenTopoMap',
  28. 'layer' => 'L.tileLayer.provider("OpenTopoMap")'
  29. ),
  30. 'hydda' => array(
  31. 'nom' => 'Hydda',
  32. 'layer' => 'L.tileLayer.provider("Hydda")'
  33. ),
  34. 'hydda_base' => array(
  35. 'nom' => 'Hydda Base',
  36. 'layer' => 'L.tileLayer.provider("Hydda.Base")'
  37. ),
  38. 'wikimedia' => array(
  39. 'nom' => 'Wikimedia',
  40. 'layer' => 'L.tileLayer.provider("Wikimedia")'
  41. ),
  42. 'cartodb_positron' => array(
  43. 'nom' => 'CartoDB Positron',
  44. 'layer' => 'L.tileLayer.provider("CartoDB.Positron")'
  45. ),
  46. 'cartodb_positron_base' => array(
  47. 'nom' => 'CartoDB Positron Base',
  48. 'layer' => 'L.tileLayer.provider("CartoDB.PositronNoLabels")'
  49. ),
  50. 'cartodb_darkmatter' => array(
  51. 'nom' => 'CartoDB DarkMatter',
  52. 'layer' => 'L.tileLayer.provider("CartoDB.DarkMatter")'
  53. ),
  54. 'cartodb_darkmatter_base' => array(
  55. 'nom' => 'CartoDB DarkMatter Base',
  56. 'layer' => 'L.tileLayer.provider("CartoDB.DarkMatterNoLabels")'
  57. ),
  58. 'cartodb_voyager' => array(
  59. 'nom' => 'CartoDB Voyager',
  60. 'layer' => 'L.tileLayer.provider("CartoDB.Voyager")'
  61. ),
  62. 'cartodb_voyager_base' => array(
  63. 'nom' => 'CartoDB Voyager Base',
  64. 'layer' => 'L.tileLayer.provider("CartoDB.VoyagerNoLabels")'
  65. ),
  66. 'stamen_toner' => array(
  67. 'nom' => 'Stamen Toner',
  68. 'layer' => 'L.tileLayer.provider("Stamen.Toner")'
  69. ),
  70. 'stamen_tonerlite' => array(
  71. 'nom' => 'Stamen Toner Lite',
  72. 'layer' => 'L.tileLayer.provider("Stamen.TonerLite")'
  73. ),
  74. 'stamen_terrain' => array(
  75. 'nom' => 'Stamen Terrain',
  76. 'layer' => 'L.tileLayer.provider("Stamen.Terrain")'
  77. ),
  78. 'stamen_watercolor' => array(
  79. 'nom' => 'Stamen Watercolor',
  80. 'layer' => 'L.tileLayer.provider("Stamen.Watercolor")'
  81. ),
  82. 'esri_worldstreetmap' => array(
  83. 'nom' => 'Esri WorldStreetMap',
  84. 'layer' => 'L.tileLayer.provider("Esri.WorldStreetMap")'
  85. ),
  86. 'esri_delorme' => array(
  87. 'nom' => 'Esri DeLorme',
  88. 'layer' => 'L.tileLayer.provider("Esri.DeLorme")'
  89. ),
  90. 'esri_worldtopomap' => array(
  91. 'nom' => 'Esri WorldTopoMap',
  92. 'layer' => 'L.tileLayer.provider("Esri.WorldTopoMap")'
  93. ),
  94. 'esri_worldimagery' => array(
  95. 'nom' => 'Esri WorldImagery',
  96. 'layer' => 'L.tileLayer.provider("Esri.WorldImagery")'
  97. ),
  98. 'esri_worldterrain' => array(
  99. 'nom' => 'Esri WorldTerrain',
  100. 'layer' => 'L.tileLayer.provider("Esri.WorldTerrain")'
  101. ),
  102. 'esri_worldshadedrelief' => array(
  103. 'nom' => 'Esri WorldShadedRelief',
  104. 'layer' => 'L.tileLayer.provider("Esri.WorldShadedRelief")'
  105. ),
  106. 'esri_worldphysical' => array(
  107. 'nom' => 'Esri WorldPhysical',
  108. 'layer' => 'L.tileLayer.provider("Esri.WorldPhysical")'
  109. ),
  110. 'esri_oceanbasemap' => array(
  111. 'nom' => 'Esri OceanBasemap',
  112. 'layer' => 'L.tileLayer.provider("Esri.OceanBasemap")'
  113. ),
  114. 'esri_natgeoworldmap' => array(
  115. 'nom' => 'Esri NatGeoWorldMap',
  116. 'layer' => 'L.tileLayer.provider("Esri.NatGeoWorldMap")'
  117. ),
  118. 'esri_worldgraycanvas' => array(
  119. 'nom' => 'Esri WorldGrayCanvas',
  120. 'layer' => 'L.tileLayer.provider("Esri.WorldGrayCanvas")'
  121. ),
  122. 'bing_aerial' => array(
  123. 'nom' => 'Bing Aerial',
  124. 'layer' => 'L.BingLayer("'.$api_key_bing.'")'
  125. ),
  126. 'google_roadmap' => array(
  127. 'nom' => 'Google Roadmap',
  128. 'layer' => 'L.gridLayer.googleMutant({type:"roadmap"})'
  129. ),
  130. 'google_satellite' => array(
  131. 'nom' => 'Google Satellite',
  132. 'layer' => 'L.gridLayer.googleMutant({type:"satellite"})'
  133. ),
  134. 'google_terrain' => array(
  135. 'nom' => 'Google Terrain',
  136. 'layer' => 'L.gridLayer.googleMutant({type:"terrain"})'
  137. )
  138. );
  139. if (isset($GLOBALS['gis_layers']) and is_array($GLOBALS['gis_layers'])) {
  140. $GLOBALS['gis_layers'] = array_merge($gis_layers, $GLOBALS['gis_layers']);
  141. } else {
  142. $GLOBALS['gis_layers'] = $gis_layers;
  143. }