OpenLayers.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. /* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
  2. * full list of contributors). Published under the 2-clause BSD license.
  3. * See license.txt in the OpenLayers distribution or repository for the
  4. * full text of the license. */
  5. /*
  6. * @requires OpenLayers/BaseTypes.js
  7. * @requires OpenLayers/Lang/en.js
  8. * @requires OpenLayers/Console.js
  9. */
  10. /*
  11. * TODO: In 3.0, we will stop supporting build profiles that include
  12. * OpenLayers.js. This means we will not need the singleFile and scriptFile
  13. * variables, because we don't have to handle the singleFile case any more.
  14. */
  15. (function() {
  16. /**
  17. * Before creating the OpenLayers namespace, check to see if
  18. * OpenLayers.singleFile is true. This occurs if the
  19. * OpenLayers/SingleFile.js script is included before this one - as is the
  20. * case with old single file build profiles that included both
  21. * OpenLayers.js and OpenLayers/SingleFile.js.
  22. */
  23. var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile);
  24. /**
  25. * Relative path of this script.
  26. */
  27. var scriptName = (!singleFile) ? "lib/OpenLayers.js" : "OpenLayers.js";
  28. /*
  29. * If window.OpenLayers isn't set when this script (OpenLayers.js) is
  30. * evaluated (and if singleFile is false) then this script will load
  31. * *all* OpenLayers scripts. If window.OpenLayers is set to an array
  32. * then this script will attempt to load scripts for each string of
  33. * the array, using the string as the src of the script.
  34. *
  35. * Example:
  36. * (code)
  37. * <script type="text/javascript">
  38. * window.OpenLayers = [
  39. * "OpenLayers/Util.js",
  40. * "OpenLayers/BaseTypes.js"
  41. * ];
  42. * </script>
  43. * <script type="text/javascript" src="../lib/OpenLayers.js"></script>
  44. * (end)
  45. * In this example OpenLayers.js will load Util.js and BaseTypes.js only.
  46. */
  47. var jsFiles = window.OpenLayers;
  48. /**
  49. * Namespace: OpenLayers
  50. * The OpenLayers object provides a namespace for all things OpenLayers
  51. */
  52. window.OpenLayers = {
  53. /**
  54. * Method: _getScriptLocation
  55. * Return the path to this script. This is also implemented in
  56. * OpenLayers/SingleFile.js
  57. *
  58. * Returns:
  59. * {String} Path to this script
  60. */
  61. _getScriptLocation: (function() {
  62. var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"),
  63. s = document.getElementsByTagName('script'),
  64. src, m, l = "";
  65. for(var i=0, len=s.length; i<len; i++) {
  66. src = s[i].getAttribute('src');
  67. if(src) {
  68. m = src.match(r);
  69. if(m) {
  70. l = m[1];
  71. break;
  72. }
  73. }
  74. }
  75. return (function() { return l; });
  76. })(),
  77. /**
  78. * APIProperty: ImgPath
  79. * {String} Set this to the path where control images are stored, a path
  80. * given here must end with a slash. If set to '' (which is the default)
  81. * OpenLayers will use its script location + "img/".
  82. *
  83. * You will need to set this property when you have a singlefile build of
  84. * OpenLayers that either is not named "OpenLayers.js" or if you move
  85. * the file in a way such that the image directory cannot be derived from
  86. * the script location.
  87. *
  88. * If your custom OpenLayers build is named "my-custom-ol.js" and the images
  89. * of OpenLayers are in a folder "/resources/external/images/ol" a correct
  90. * way of including OpenLayers in your HTML would be:
  91. *
  92. * (code)
  93. * <script src="/path/to/my-custom-ol.js" type="text/javascript"></script>
  94. * <script type="text/javascript">
  95. * // tell OpenLayers where the control images are
  96. * // remember the trailing slash
  97. * OpenLayers.ImgPath = "/resources/external/images/ol/";
  98. * </script>
  99. * (end code)
  100. *
  101. * Please remember that when your OpenLayers script is not named
  102. * "OpenLayers.js" you will have to make sure that the default theme is
  103. * loaded into the page by including an appropriate <link>-tag,
  104. * e.g.:
  105. *
  106. * (code)
  107. * <link rel="stylesheet" href="/path/to/default/style.css" type="text/css">
  108. * (end code)
  109. */
  110. ImgPath : ''
  111. };
  112. /**
  113. * OpenLayers.singleFile is a flag indicating this file is being included
  114. * in a Single File Library build of the OpenLayers Library.
  115. *
  116. * When we are *not* part of a SFL build we dynamically include the
  117. * OpenLayers library code.
  118. *
  119. * When we *are* part of a SFL build we do not dynamically include the
  120. * OpenLayers library code as it will be appended at the end of this file.
  121. */
  122. if(!singleFile) {
  123. if (!jsFiles) {
  124. jsFiles = [
  125. "OpenLayers/BaseTypes/Class.js",
  126. "OpenLayers/Util.js",
  127. "OpenLayers/Util/vendorPrefix.js",
  128. "OpenLayers/Animation.js",
  129. "OpenLayers/BaseTypes.js",
  130. "OpenLayers/BaseTypes/Bounds.js",
  131. "OpenLayers/BaseTypes/Date.js",
  132. "OpenLayers/BaseTypes/Element.js",
  133. "OpenLayers/BaseTypes/LonLat.js",
  134. "OpenLayers/BaseTypes/Pixel.js",
  135. "OpenLayers/BaseTypes/Size.js",
  136. "OpenLayers/Console.js",
  137. "OpenLayers/Tween.js",
  138. "OpenLayers/Kinetic.js",
  139. "OpenLayers/Events.js",
  140. "OpenLayers/Events/buttonclick.js",
  141. "OpenLayers/Events/featureclick.js",
  142. "OpenLayers/Request.js",
  143. "OpenLayers/Request/XMLHttpRequest.js",
  144. "OpenLayers/Projection.js",
  145. "OpenLayers/Map.js",
  146. "OpenLayers/Layer.js",
  147. "OpenLayers/Icon.js",
  148. "OpenLayers/Marker.js",
  149. "OpenLayers/Marker/Box.js",
  150. "OpenLayers/Popup.js",
  151. "OpenLayers/Tile.js",
  152. "OpenLayers/Tile/Image.js",
  153. "OpenLayers/Tile/Image/IFrame.js",
  154. "OpenLayers/Tile/UTFGrid.js",
  155. "OpenLayers/Layer/Image.js",
  156. "OpenLayers/Layer/SphericalMercator.js",
  157. "OpenLayers/Layer/EventPane.js",
  158. "OpenLayers/Layer/FixedZoomLevels.js",
  159. "OpenLayers/Layer/Google.js",
  160. "OpenLayers/Layer/Google/v3.js",
  161. "OpenLayers/Layer/HTTPRequest.js",
  162. "OpenLayers/Layer/Grid.js",
  163. "OpenLayers/Layer/MapGuide.js",
  164. "OpenLayers/Layer/MapServer.js",
  165. "OpenLayers/Layer/KaMap.js",
  166. "OpenLayers/Layer/KaMapCache.js",
  167. "OpenLayers/Layer/Markers.js",
  168. "OpenLayers/Layer/Text.js",
  169. "OpenLayers/Layer/WorldWind.js",
  170. "OpenLayers/Layer/ArcGIS93Rest.js",
  171. "OpenLayers/Layer/WMS.js",
  172. "OpenLayers/Layer/WMTS.js",
  173. "OpenLayers/Layer/ArcIMS.js",
  174. "OpenLayers/Layer/GeoRSS.js",
  175. "OpenLayers/Layer/Boxes.js",
  176. "OpenLayers/Layer/XYZ.js",
  177. "OpenLayers/Layer/UTFGrid.js",
  178. "OpenLayers/Layer/OSM.js",
  179. "OpenLayers/Layer/Bing.js",
  180. "OpenLayers/Layer/TMS.js",
  181. "OpenLayers/Layer/TileCache.js",
  182. "OpenLayers/Layer/Zoomify.js",
  183. "OpenLayers/Layer/ArcGISCache.js",
  184. "OpenLayers/Popup/Anchored.js",
  185. "OpenLayers/Popup/Framed.js",
  186. "OpenLayers/Popup/FramedCloud.js",
  187. "OpenLayers/Feature.js",
  188. "OpenLayers/Feature/Vector.js",
  189. "OpenLayers/Handler.js",
  190. "OpenLayers/Handler/Click.js",
  191. "OpenLayers/Handler/Hover.js",
  192. "OpenLayers/Handler/Point.js",
  193. "OpenLayers/Handler/Path.js",
  194. "OpenLayers/Handler/Polygon.js",
  195. "OpenLayers/Handler/Feature.js",
  196. "OpenLayers/Handler/Drag.js",
  197. "OpenLayers/Handler/Pinch.js",
  198. "OpenLayers/Handler/RegularPolygon.js",
  199. "OpenLayers/Handler/Box.js",
  200. "OpenLayers/Handler/MouseWheel.js",
  201. "OpenLayers/Handler/Keyboard.js",
  202. "OpenLayers/Control.js",
  203. "OpenLayers/Control/Attribution.js",
  204. "OpenLayers/Control/Button.js",
  205. "OpenLayers/Control/CacheRead.js",
  206. "OpenLayers/Control/CacheWrite.js",
  207. "OpenLayers/Control/ZoomBox.js",
  208. "OpenLayers/Control/ZoomToMaxExtent.js",
  209. "OpenLayers/Control/DragPan.js",
  210. "OpenLayers/Control/Navigation.js",
  211. "OpenLayers/Control/PinchZoom.js",
  212. "OpenLayers/Control/TouchNavigation.js",
  213. "OpenLayers/Control/MousePosition.js",
  214. "OpenLayers/Control/OverviewMap.js",
  215. "OpenLayers/Control/KeyboardDefaults.js",
  216. "OpenLayers/Control/PanZoom.js",
  217. "OpenLayers/Control/PanZoomBar.js",
  218. "OpenLayers/Control/ArgParser.js",
  219. "OpenLayers/Control/Permalink.js",
  220. "OpenLayers/Control/Scale.js",
  221. "OpenLayers/Control/ScaleLine.js",
  222. "OpenLayers/Control/Snapping.js",
  223. "OpenLayers/Control/Split.js",
  224. "OpenLayers/Control/LayerSwitcher.js",
  225. "OpenLayers/Control/DrawFeature.js",
  226. "OpenLayers/Control/DragFeature.js",
  227. "OpenLayers/Control/ModifyFeature.js",
  228. "OpenLayers/Control/Panel.js",
  229. "OpenLayers/Control/SelectFeature.js",
  230. "OpenLayers/Control/NavigationHistory.js",
  231. "OpenLayers/Control/Measure.js",
  232. "OpenLayers/Control/WMSGetFeatureInfo.js",
  233. "OpenLayers/Control/WMTSGetFeatureInfo.js",
  234. "OpenLayers/Control/Graticule.js",
  235. "OpenLayers/Control/TransformFeature.js",
  236. "OpenLayers/Control/UTFGrid.js",
  237. "OpenLayers/Control/SLDSelect.js",
  238. "OpenLayers/Control/Zoom.js",
  239. "OpenLayers/Geometry.js",
  240. "OpenLayers/Geometry/Collection.js",
  241. "OpenLayers/Geometry/Point.js",
  242. "OpenLayers/Geometry/MultiPoint.js",
  243. "OpenLayers/Geometry/Curve.js",
  244. "OpenLayers/Geometry/LineString.js",
  245. "OpenLayers/Geometry/LinearRing.js",
  246. "OpenLayers/Geometry/Polygon.js",
  247. "OpenLayers/Geometry/MultiLineString.js",
  248. "OpenLayers/Geometry/MultiPolygon.js",
  249. "OpenLayers/Renderer.js",
  250. "OpenLayers/Renderer/Elements.js",
  251. "OpenLayers/Renderer/SVG.js",
  252. "OpenLayers/Renderer/Canvas.js",
  253. "OpenLayers/Renderer/VML.js",
  254. "OpenLayers/Layer/Vector.js",
  255. "OpenLayers/Layer/PointGrid.js",
  256. "OpenLayers/Layer/Vector/RootContainer.js",
  257. "OpenLayers/Strategy.js",
  258. "OpenLayers/Strategy/Filter.js",
  259. "OpenLayers/Strategy/Fixed.js",
  260. "OpenLayers/Strategy/Cluster.js",
  261. "OpenLayers/Strategy/Paging.js",
  262. "OpenLayers/Strategy/BBOX.js",
  263. "OpenLayers/Strategy/Save.js",
  264. "OpenLayers/Strategy/Refresh.js",
  265. "OpenLayers/Filter.js",
  266. "OpenLayers/Filter/FeatureId.js",
  267. "OpenLayers/Filter/Logical.js",
  268. "OpenLayers/Filter/Comparison.js",
  269. "OpenLayers/Filter/Spatial.js",
  270. "OpenLayers/Filter/Function.js",
  271. "OpenLayers/Protocol.js",
  272. "OpenLayers/Protocol/HTTP.js",
  273. "OpenLayers/Protocol/WFS.js",
  274. "OpenLayers/Protocol/WFS/v1.js",
  275. "OpenLayers/Protocol/WFS/v1_0_0.js",
  276. "OpenLayers/Protocol/WFS/v1_1_0.js",
  277. "OpenLayers/Protocol/CSW.js",
  278. "OpenLayers/Protocol/CSW/v2_0_2.js",
  279. "OpenLayers/Protocol/Script.js",
  280. "OpenLayers/Protocol/SOS.js",
  281. "OpenLayers/Protocol/SOS/v1_0_0.js",
  282. "OpenLayers/Layer/PointTrack.js",
  283. "OpenLayers/Style.js",
  284. "OpenLayers/Style2.js",
  285. "OpenLayers/StyleMap.js",
  286. "OpenLayers/Rule.js",
  287. "OpenLayers/Format.js",
  288. "OpenLayers/Format/QueryStringFilter.js",
  289. "OpenLayers/Format/XML.js",
  290. "OpenLayers/Format/XML/VersionedOGC.js",
  291. "OpenLayers/Format/Context.js",
  292. "OpenLayers/Format/ArcXML.js",
  293. "OpenLayers/Format/ArcXML/Features.js",
  294. "OpenLayers/Format/GML.js",
  295. "OpenLayers/Format/GML/Base.js",
  296. "OpenLayers/Format/GML/v2.js",
  297. "OpenLayers/Format/GML/v3.js",
  298. "OpenLayers/Format/Atom.js",
  299. "OpenLayers/Format/EncodedPolyline.js",
  300. "OpenLayers/Format/KML.js",
  301. "OpenLayers/Format/GeoRSS.js",
  302. "OpenLayers/Format/WFS.js",
  303. "OpenLayers/Format/OWSCommon.js",
  304. "OpenLayers/Format/OWSCommon/v1.js",
  305. "OpenLayers/Format/OWSCommon/v1_0_0.js",
  306. "OpenLayers/Format/OWSCommon/v1_1_0.js",
  307. "OpenLayers/Format/WCSCapabilities.js",
  308. "OpenLayers/Format/WCSCapabilities/v1.js",
  309. "OpenLayers/Format/WCSCapabilities/v1_0_0.js",
  310. "OpenLayers/Format/WCSCapabilities/v1_1_0.js",
  311. "OpenLayers/Format/WFSCapabilities.js",
  312. "OpenLayers/Format/WFSCapabilities/v1.js",
  313. "OpenLayers/Format/WFSCapabilities/v1_0_0.js",
  314. "OpenLayers/Format/WFSCapabilities/v1_1_0.js",
  315. "OpenLayers/Format/WFSDescribeFeatureType.js",
  316. "OpenLayers/Format/WMSDescribeLayer.js",
  317. "OpenLayers/Format/WMSDescribeLayer/v1_1.js",
  318. "OpenLayers/Format/WKT.js",
  319. "OpenLayers/Format/CQL.js",
  320. "OpenLayers/Format/OSM.js",
  321. "OpenLayers/Format/GPX.js",
  322. "OpenLayers/Format/Filter.js",
  323. "OpenLayers/Format/Filter/v1.js",
  324. "OpenLayers/Format/Filter/v1_0_0.js",
  325. "OpenLayers/Format/Filter/v1_1_0.js",
  326. "OpenLayers/Format/SLD.js",
  327. "OpenLayers/Format/SLD/v1.js",
  328. "OpenLayers/Format/SLD/v1_0_0.js",
  329. "OpenLayers/Format/SLD/v1_0_0_GeoServer.js",
  330. "OpenLayers/Format/OWSCommon.js",
  331. "OpenLayers/Format/OWSCommon/v1.js",
  332. "OpenLayers/Format/OWSCommon/v1_0_0.js",
  333. "OpenLayers/Format/OWSCommon/v1_1_0.js",
  334. "OpenLayers/Format/CSWGetDomain.js",
  335. "OpenLayers/Format/CSWGetDomain/v2_0_2.js",
  336. "OpenLayers/Format/CSWGetRecords.js",
  337. "OpenLayers/Format/CSWGetRecords/v2_0_2.js",
  338. "OpenLayers/Format/WFST.js",
  339. "OpenLayers/Format/WFST/v1.js",
  340. "OpenLayers/Format/WFST/v1_0_0.js",
  341. "OpenLayers/Format/WFST/v1_1_0.js",
  342. "OpenLayers/Format/Text.js",
  343. "OpenLayers/Format/JSON.js",
  344. "OpenLayers/Format/GeoJSON.js",
  345. "OpenLayers/Format/WMC.js",
  346. "OpenLayers/Format/WMC/v1.js",
  347. "OpenLayers/Format/WMC/v1_0_0.js",
  348. "OpenLayers/Format/WMC/v1_1_0.js",
  349. "OpenLayers/Format/WCSGetCoverage.js",
  350. "OpenLayers/Format/WMSCapabilities.js",
  351. "OpenLayers/Format/WMSCapabilities/v1.js",
  352. "OpenLayers/Format/WMSCapabilities/v1_1.js",
  353. "OpenLayers/Format/WMSCapabilities/v1_1_0.js",
  354. "OpenLayers/Format/WMSCapabilities/v1_1_1.js",
  355. "OpenLayers/Format/WMSCapabilities/v1_3.js",
  356. "OpenLayers/Format/WMSCapabilities/v1_3_0.js",
  357. "OpenLayers/Format/WMSCapabilities/v1_1_1_WMSC.js",
  358. "OpenLayers/Format/WMSGetFeatureInfo.js",
  359. "OpenLayers/Format/SOSCapabilities.js",
  360. "OpenLayers/Format/SOSCapabilities/v1_0_0.js",
  361. "OpenLayers/Format/SOSGetFeatureOfInterest.js",
  362. "OpenLayers/Format/SOSGetObservation.js",
  363. "OpenLayers/Format/OWSContext.js",
  364. "OpenLayers/Format/OWSContext/v0_3_1.js",
  365. "OpenLayers/Format/WMTSCapabilities.js",
  366. "OpenLayers/Format/WMTSCapabilities/v1_0_0.js",
  367. "OpenLayers/Format/WPSCapabilities.js",
  368. "OpenLayers/Format/WPSCapabilities/v1_0_0.js",
  369. "OpenLayers/Format/WPSDescribeProcess.js",
  370. "OpenLayers/Format/WPSExecute.js",
  371. "OpenLayers/Format/XLS.js",
  372. "OpenLayers/Format/XLS/v1.js",
  373. "OpenLayers/Format/XLS/v1_1_0.js",
  374. "OpenLayers/Format/OGCExceptionReport.js",
  375. "OpenLayers/Control/GetFeature.js",
  376. "OpenLayers/Control/NavToolbar.js",
  377. "OpenLayers/Control/PanPanel.js",
  378. "OpenLayers/Control/Pan.js",
  379. "OpenLayers/Control/ZoomIn.js",
  380. "OpenLayers/Control/ZoomOut.js",
  381. "OpenLayers/Control/ZoomPanel.js",
  382. "OpenLayers/Control/EditingToolbar.js",
  383. "OpenLayers/Control/Geolocate.js",
  384. "OpenLayers/Symbolizer.js",
  385. "OpenLayers/Symbolizer/Point.js",
  386. "OpenLayers/Symbolizer/Line.js",
  387. "OpenLayers/Symbolizer/Polygon.js",
  388. "OpenLayers/Symbolizer/Text.js",
  389. "OpenLayers/Symbolizer/Raster.js",
  390. "OpenLayers/Lang.js",
  391. "OpenLayers/Lang/en.js",
  392. "OpenLayers/Spherical.js",
  393. "OpenLayers/TileManager.js",
  394. "OpenLayers/WPSClient.js",
  395. "OpenLayers/WPSProcess.js"
  396. ]; // etc.
  397. }
  398. // use "parser-inserted scripts" for guaranteed execution order
  399. // http://hsivonen.iki.fi/script-execution/
  400. var scriptTags = new Array(jsFiles.length);
  401. var host = OpenLayers._getScriptLocation() + "lib/";
  402. for (var i=0, len=jsFiles.length; i<len; i++) {
  403. scriptTags[i] = "<script src='" + host + jsFiles[i] +
  404. "'></script>";
  405. }
  406. if (scriptTags.length > 0) {
  407. document.write(scriptTags.join(""));
  408. }
  409. }
  410. })();
  411. /**
  412. * Constant: VERSION_NUMBER
  413. *
  414. * This constant identifies the version of OpenLayers.
  415. *
  416. * When asking questions or reporting issues, make sure to include the output of
  417. * OpenLayers.VERSION_NUMBER in the question or issue-description.
  418. */
  419. OpenLayers.VERSION_NUMBER="Release 2.13.1";