Permalink
Browse files

Merge remote branch 'remotes/OpenLayers/master' into 3180-UI_non_UI_c…

…ontrols
  • Loading branch information...
2 parents f4c0892 + 56e25fc commit 86ccab7fe774f4bbd116d7bab90a13ec42a22c03 @jorix committed Mar 12, 2012
Showing with 3,698 additions and 446 deletions.
  1. +1 −0 apidoc_config/Menu.txt
  2. +8 −4 build/build.py
  3. +32 −0 build/light.cfg
  4. +0 −1 build/mobile.cfg
  5. +1 −0 doc_config/Menu.txt
  6. +1 −1 examples/all-overlays-google.html
  7. +32 −0 examples/cross-origin-xml.html
  8. +25 −0 examples/cross-origin-xml.js
  9. +1 −1 examples/google-v3.html
  10. +73 −0 examples/mapbox.html
  11. +34 −0 examples/mapbox.js
  12. +1 −1 examples/osm-google.html
  13. +77 −0 examples/osm-grayscale.html
  14. +1 −1 examples/spherical-mercator.html
  15. +51 −0 examples/utfgrid-geography-class.html
  16. +62 −0 examples/utfgrid-geography-class.js
  17. +64 −0 examples/utfgrid.html
  18. +61 −0 examples/utfgrid.js
  19. +1 −0 examples/utfgrid/bio_utfgrid/1/0/0.json
  20. +1 −0 examples/utfgrid/bio_utfgrid/1/0/1.json
  21. +1 −0 examples/utfgrid/bio_utfgrid/1/0/2.json
  22. +1 −0 examples/utfgrid/bio_utfgrid/1/1/0.json
  23. +1 −0 examples/utfgrid/bio_utfgrid/1/1/1.json
  24. +1 −0 examples/utfgrid/bio_utfgrid/1/1/2.json
  25. +1 −0 examples/utfgrid/bio_utfgrid/1/2/0.json
  26. +1 −0 examples/utfgrid/bio_utfgrid/1/2/1.json
  27. +1 −0 examples/utfgrid/bio_utfgrid/1/2/2.json
  28. +1 −0 examples/utfgrid/geography-class/0/0/0.grid.json
  29. +1 −0 examples/utfgrid/geography-class/1/0/0.grid.json
  30. +1 −0 examples/utfgrid/geography-class/1/0/1.grid.json
  31. +1 −0 examples/utfgrid/geography-class/1/1/0.grid.json
  32. +1 −0 examples/utfgrid/geography-class/1/1/1.grid.json
  33. +1 −0 examples/utfgrid/geography-class/2/0/0.grid.json
  34. +1 −0 examples/utfgrid/geography-class/2/0/1.grid.json
  35. +1 −0 examples/utfgrid/geography-class/2/0/2.grid.json
  36. +1 −0 examples/utfgrid/geography-class/2/0/3.grid.json
  37. +1 −0 examples/utfgrid/geography-class/2/1/0.grid.json
  38. +1 −0 examples/utfgrid/geography-class/2/1/1.grid.json
  39. +1 −0 examples/utfgrid/geography-class/2/1/2.grid.json
  40. +1 −0 examples/utfgrid/geography-class/2/1/3.grid.json
  41. +1 −0 examples/utfgrid/geography-class/2/2/0.grid.json
  42. +1 −0 examples/utfgrid/geography-class/2/2/1.grid.json
  43. +1 −0 examples/utfgrid/geography-class/2/2/2.grid.json
  44. +1 −0 examples/utfgrid/geography-class/2/2/3.grid.json
  45. +1 −0 examples/utfgrid/geography-class/2/3/0.grid.json
  46. +1 −0 examples/utfgrid/geography-class/2/3/1.grid.json
  47. +1 −0 examples/utfgrid/geography-class/2/3/2.grid.json
  48. +1 −0 examples/utfgrid/geography-class/2/3/3.grid.json
  49. +1 −0 examples/utfgrid/world_utfgrid/1/0/0.json
  50. +1 −0 examples/utfgrid/world_utfgrid/1/0/1.json
  51. +1 −0 examples/utfgrid/world_utfgrid/1/0/2.json
  52. +1 −0 examples/utfgrid/world_utfgrid/1/1/0.json
  53. +1 −0 examples/utfgrid/world_utfgrid/1/1/1.json
  54. +1 −0 examples/utfgrid/world_utfgrid/1/1/2.json
  55. +1 −0 examples/utfgrid/world_utfgrid/1/2/0.json
  56. +1 −0 examples/utfgrid/world_utfgrid/1/2/1.json
  57. +1 −0 examples/utfgrid/world_utfgrid/1/2/2.json
  58. +51 −0 examples/utfgrid_twogrids.html
  59. +70 −0 examples/utfgrid_twogrids.js
  60. +68 −0 examples/zoom.html
  61. +34 −0 examples/zoom.js
  62. +40 −1 lib/OpenLayers.js
  63. +1 −1 lib/OpenLayers/Animation.js
  64. +30 −1 lib/OpenLayers/BaseTypes.js
  65. +6 −2 lib/OpenLayers/BaseTypes/Bounds.js
  66. +4 −0 lib/OpenLayers/BaseTypes/Date.js
  67. +2 −2 lib/OpenLayers/BaseTypes/Element.js
  68. +6 −2 lib/OpenLayers/BaseTypes/LonLat.js
  69. +2 −1 lib/OpenLayers/Control/ArgParser.js
  70. +3 −3 lib/OpenLayers/Control/GetFeature.js
  71. +3 −0 lib/OpenLayers/Control/Graticule.js
  72. +2 −2 lib/OpenLayers/Control/Measure.js
  73. +1 −2 lib/OpenLayers/Control/ModifyFeature.js
  74. +3 −3 lib/OpenLayers/Control/OverviewMap.js
  75. +6 −5 lib/OpenLayers/Control/Permalink.js
  76. +240 −0 lib/OpenLayers/Control/UTFGrid.js
  77. +1 −0 lib/OpenLayers/Control/WMSGetFeatureInfo.js
  78. +139 −0 lib/OpenLayers/Control/Zoom.js
  79. +3 −3 lib/OpenLayers/Filter/Comparison.js
  80. +3 −3 lib/OpenLayers/Format/Atom.js
  81. +1 −0 lib/OpenLayers/Format/GML.js
  82. +1 −1 lib/OpenLayers/Format/GML/Base.js
  83. +1 −1 lib/OpenLayers/Format/GML/v3.js
  84. +1 −1 lib/OpenLayers/Format/GPX.js
  85. +1 −1 lib/OpenLayers/Format/GeoJSON.js
  86. +82 −8 lib/OpenLayers/Format/KML.js
  87. +1 −1 lib/OpenLayers/Format/OSM.js
  88. +2 −2 lib/OpenLayers/Format/SLD/v1.js
  89. +1 −1 lib/OpenLayers/Format/SLD/v1_0_0_GeoServer.js
  90. +1 −1 lib/OpenLayers/Format/Text.js
  91. +5 −3 lib/OpenLayers/Format/WFSDescribeFeatureType.js
  92. +7 −6 lib/OpenLayers/Format/WMC/v1.js
  93. +1 −1 lib/OpenLayers/Format/WMSGetFeatureInfo.js
  94. +4 −4 lib/OpenLayers/Handler/Box.js
  95. +6 −2 lib/OpenLayers/Handler/Click.js
  96. +1 −1 lib/OpenLayers/Handler/Feature.js
  97. +1 −1 lib/OpenLayers/Lang.js
  98. +93 −0 lib/OpenLayers/Lang/pl.js
  99. +8 −3 lib/OpenLayers/Layer.js
  100. +4 −3 lib/OpenLayers/Layer/ArcGIS93Rest.js
  101. +1 −1 lib/OpenLayers/Layer/ArcIMS.js
  102. +2 −2 lib/OpenLayers/Layer/Google.js
  103. +103 −6 lib/OpenLayers/Layer/Grid.js
  104. +1 −1 lib/OpenLayers/Layer/KaMap.js
  105. +1 −1 lib/OpenLayers/Layer/MapGuide.js
  106. +6 −2 lib/OpenLayers/Layer/OSM.js
  107. +178 −0 lib/OpenLayers/Layer/UTFGrid.js
  108. +5 −2 lib/OpenLayers/Layer/Vector.js
  109. +1 −1 lib/OpenLayers/Layer/WMTS.js
  110. +1 −1 lib/OpenLayers/Layer/Zoomify.js
  111. +63 −29 lib/OpenLayers/Map.js
  112. +1 −0 lib/OpenLayers/Marker.js
  113. +7 −5 lib/OpenLayers/Popup.js
  114. +1 −1 lib/OpenLayers/Protocol/HTTP.js
  115. +1 −0 lib/OpenLayers/Protocol/SOS/v1_0_0.js
  116. +28 −21 lib/OpenLayers/Protocol/Script.js
  117. +2 −0 lib/OpenLayers/Protocol/WFS.js
  118. +2 −2 lib/OpenLayers/Renderer.js
  119. +0 −22 lib/OpenLayers/Renderer/Canvas.js
  120. +1 −1 lib/OpenLayers/Renderer/Elements.js
  121. +36 −1 lib/OpenLayers/SingleFile.js
  122. +4 −0 lib/OpenLayers/Spherical.js
  123. +1 −1 lib/OpenLayers/Strategy.js
  124. +2 −1 lib/OpenLayers/Strategy/BBOX.js
  125. +1 −1 lib/OpenLayers/Strategy/Filter.js
  126. +1 −1 lib/OpenLayers/Strategy/Paging.js
  127. +1 −1 lib/OpenLayers/Style.js
  128. +5 −1 lib/OpenLayers/Tile.js
  129. +17 −9 lib/OpenLayers/Tile/Image.js
  130. +251 −0 lib/OpenLayers/Tile/UTFGrid.js
  131. +27 −0 lib/OpenLayers/Tween.js
  132. +4 −7 lib/OpenLayers/Util.js
  133. +0 −24 lib/deprecated.js
  134. +73 −2 notes/2.12.md
  135. +1 −1 readme.md
  136. +12 −2 tests/Animation.html
  137. +27 −0 tests/BaseTypes.html
  138. +3 −3 tests/Control/Measure.html
  139. +13 −2 tests/Control/PanZoom.html
  140. +91 −0 tests/Control/Permalink.html
  141. +119 −0 tests/Control/UTFGrid.html
  142. +29 −0 tests/Control/WMSGetFeatureInfo.html
  143. +81 −0 tests/Control/Zoom.html
  144. +73 −47 tests/Format/KML.html
  145. +66 −2 tests/Format/SLD/v1_0_0_GeoServer.html
  146. +1 −1 tests/Handler/Box.html
  147. +1 −1 tests/Layer/Google/v3.html
  148. +204 −14 tests/Layer/Grid.html
  149. +115 −0 tests/Layer/UTFGrid.html
  150. +25 −0 tests/Layer/Vector.html
  151. +5 −3 tests/OpenLayers1.html
  152. +1 −1 tests/Protocol/CSW.html
  153. +7 −1 tests/Protocol/Script.html
  154. +3 −1 tests/Renderer/SVG.html
  155. +17 −17 tests/Renderer/VML.html
  156. +3 −3 tests/Test.AnotherWay.baseadditions.js
  157. +44 −27 tests/Tile/Image.html
  158. +5 −5 tests/Tile/Image/IFrame.html
  159. +305 −0 tests/Tile/UTFGrid.html
  160. +15 −0 tests/Tween.html
  161. +25 −1 tests/Util.html
  162. +1 −0 tests/data/utfgrid/bio_utfgrid/1/0/0.json
  163. +1 −0 tests/data/utfgrid/bio_utfgrid/1/0/1.json
  164. +1 −0 tests/data/utfgrid/bio_utfgrid/1/0/2.json
  165. +1 −0 tests/data/utfgrid/bio_utfgrid/1/1/0.json
  166. +1 −0 tests/data/utfgrid/bio_utfgrid/1/1/1.json
  167. +1 −0 tests/data/utfgrid/bio_utfgrid/1/1/2.json
  168. +1 −0 tests/data/utfgrid/bio_utfgrid/1/2/0.json
  169. +1 −0 tests/data/utfgrid/bio_utfgrid/1/2/1.json
  170. +1 −0 tests/data/utfgrid/bio_utfgrid/1/2/2.json
  171. +1 −0 tests/data/utfgrid/demo-1.1.json
  172. +1 −0 tests/data/utfgrid/world_utfgrid/1/0/0.json
  173. +1 −0 tests/data/utfgrid/world_utfgrid/1/0/1.json
  174. +1 −0 tests/data/utfgrid/world_utfgrid/1/0/2.json
  175. +1 −0 tests/data/utfgrid/world_utfgrid/1/1/0.json
  176. +1 −0 tests/data/utfgrid/world_utfgrid/1/1/1.json
  177. +1 −0 tests/data/utfgrid/world_utfgrid/1/1/2.json
  178. +1 −0 tests/data/utfgrid/world_utfgrid/1/2/0.json
  179. +1 −0 tests/data/utfgrid/world_utfgrid/1/2/1.json
  180. +1 −0 tests/data/utfgrid/world_utfgrid/1/2/2.json
  181. +0 −40 tests/deprecated/BaseTypes.html
  182. +0 −40 tests/deprecated/BaseTypes/String.html
  183. +1 −0 tests/deprecated/Layer/MapServer.html
  184. +1 −0 tests/deprecated/Layer/WMS.html
  185. +4 −1 tests/list-tests.html
  186. +1 −1 tests/manual/alloverlays-mixed.html
  187. +1 −1 tests/manual/google-fullscreen-overlay.html
  188. +1 −1 tests/manual/google-tilt.html
  189. +1 −1 tests/manual/google-v3-resize.html
  190. +35 −0 theme/default/style.css
  191. +6 −0 tools/release.sh
  192. +5 −1 tools/update_dev_dir.sh
View
@@ -319,6 +319,7 @@ Group: OpenLayers {
File: nn (no auto-title, OpenLayers/Lang/nn.js)
File: oc (no auto-title, OpenLayers/Lang/oc.js)
File: pt (no auto-title, OpenLayers/Lang/pt.js)
+ File: pl (no auto-title, OpenLayers/Lang/pl.js)
File: pt-BR (no auto-title, OpenLayers/Lang/pt-BR.js)
File: ru (no auto-title, OpenLayers/Lang/ru.js)
File: sk (no auto-title, OpenLayers/Lang/sk.js)
View
@@ -51,10 +51,14 @@ def build(config_file = None, output_file = None, options = None):
outputFilename = output_file
print "Merging libraries."
- if use_compressor == "closure":
- sourceFiles = mergejs.getNames(sourceDirectory, configFilename)
- else:
- merged = mergejs.run(sourceDirectory, None, configFilename)
+ try:
+ if use_compressor == "closure":
+ sourceFiles = mergejs.getNames(sourceDirectory, configFilename)
+ else:
+ merged = mergejs.run(sourceDirectory, None, configFilename)
+ except mergejs.MissingImport, E:
+ print "\nAbnormal termination."
+ sys.exit("ERROR: %s" % E)
print "Compressing using %s" % use_compressor
if use_compressor == "jsmin":
View
@@ -0,0 +1,32 @@
+[first]
+
+[last]
+
+[include]
+OpenLayers/Map.js
+OpenLayers/Kinetic.js
+OpenLayers/Projection.js
+OpenLayers/Layer/Vector.js
+OpenLayers/Layer/OSM.js
+OpenLayers/Layer/Bing.js
+OpenLayers/Layer/WMS.js
+OpenLayers/Layer/Google/v3.js
+OpenLayers/Popup/FramedCloud.js
+OpenLayers/Control/Navigation.js
+OpenLayers/Control/ZoomPanel.js
+OpenLayers/Control/Attribution.js
+OpenLayers/Control/SelectFeature.js
+OpenLayers/Control/Panel.js
+OpenLayers/Control/LayerSwitcher.js
+OpenLayers/Renderer/SVG.js
+OpenLayers/Renderer/VML.js
+OpenLayers/Format/GeoJSON.js
+OpenLayers/Protocol/HTTP.js
+OpenLayers/Strategy/Fixed.js
+OpenLayers/Strategy/BBOX.js
+OpenLayers/StyleMap.js
+OpenLayers/Rule.js
+OpenLayers/Filter/Comparison.js
+OpenLayers/Filter/Logical.js
+
+[exclude]
View
@@ -1,5 +1,4 @@
[first]
-OpenLayers/SingleFile.js
[last]
View
@@ -319,6 +319,7 @@ Group: OpenLayers {
File: nl (no auto-title, OpenLayers/Lang/nl.js)
File: nn (no auto-title, OpenLayers/Lang/nn.js)
File: oc (no auto-title, OpenLayers/Lang/oc.js)
+ File: pl (no auto-title, OpenLayers/Lang/pl.js)
File: pt (no auto-title, OpenLayers/Lang/pt.js)
File: pt-BR (no auto-title, OpenLayers/Lang/pt-BR.js)
File: ru (no auto-title, OpenLayers/Lang/ru.js)
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
+ <script src="http://maps.google.com/maps/api/js?v=3.6&amp;sensor=false"></script>
<script src="../lib/OpenLayers.js"></script>
<script src="all-overlays-google.js"></script>
</head>
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>OpenLayers Script Protocol XML Example</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+ <link rel="stylesheet" href="style.css" type="text/css">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <script src="../lib/OpenLayers.js"></script>
+ </head>
+ <body>
+ <h1 id="title">Script Protocol With XML</h1>
+ <div id="tags">
+ protocol, script, cross origin, xml, advanced
+ </div>
+ <p id="shortdesc">
+ Demonstrates how, with a custom parseFeatures method, the script protocol can be used with YQL for cross-origin loading of files in any of the XML formats supported by OpenLayers.
+ </p>
+ <div id="map" class="smallmap"></div>
+ <div id="docs">
+ <p>
+ YQL can wrap a jsonp callback around an XML file, which effectively means Yahoo's servers are acting as a proxy for cross-origin feature loading. This example uses a GPX file, but the same technique can be used for other formats such as KML.
+ </p>
+ <p>
+ View the <a href="cross-origin-xml.js" target="_blank">cross-origin-xml.js</a>
+ source to see how this is done
+ </p>
+ </div>
+ <script src="cross-origin-xml.js"></script>
+ </body>
+</html>
@@ -0,0 +1,25 @@
+var map = new OpenLayers.Map({
+ div: "map",
+ layers: [
+ new OpenLayers.Layer.OSM(),
+ new OpenLayers.Layer.Vector("Vectors", {
+ projection: new OpenLayers.Projection("EPSG:4326"),
+ strategies: [new OpenLayers.Strategy.Fixed()],
+ protocol: new OpenLayers.Protocol.Script({
+ url: "http://query.yahooapis.com/v1/public/yql",
+ params: {
+ q: "select * from xml where url='http://www.topografix.com/fells_loop.gpx'"
+ },
+ format: new OpenLayers.Format.GPX(),
+ parseFeatures: function(data) {
+ return this.format.read(data.results[0]);
+ }
+ }),
+ eventListeners: {
+ "featuresadded": function () {
+ this.map.zoomToExtent(this.getDataExtent());
+ }
+ }
+ })
+ ]
+});
View
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
- <script src="http://maps.google.com/maps/api/js?v=3.5&amp;sensor=false"></script>
+ <script src="http://maps.google.com/maps/api/js?v=3.6&amp;sensor=false"></script>
<script src="../lib/OpenLayers.js"></script>
<script src="google-v3.js"></script>
</head>
View
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <title>OpenLayers MapBox Example</title>
+ <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+ <link rel="stylesheet" href="style.css" type="text/css">
+ <style>
+ .olControlAttribution {
+ bottom: 5px;
+ font-size: 9px;
+ }
+ div.olControlZoomPanel {
+ top: 10px;
+ left: 10px;
+ }
+ div.olControlZoomPanel .olControlZoomInItemInactive,
+ div.olControlZoomPanel .olControlZoomOutItemInactive {
+ background: rgba(0, 0, 0, 0.2);
+ position: absolute;
+ }
+ div.olControlZoomPanel .olControlZoomInItemInactive {
+ border-radius: 3px 3px 0 0;
+ }
+ div.olControlZoomPanel .olControlZoomOutItemInactive {
+ border-radius: 0 0 3px 3px ;
+ top: 20px;
+ }
+ div.olControlZoomPanel div:hover {
+ background: rgba(0, 0, 0, 0.5);
+ }
+ div.olControlZoomPanel .olControlZoomOutItemInactive:after ,
+ div.olControlZoomPanel .olControlZoomInItemInactive:after {
+ font-weight: bold;
+ content: '+';
+ font-size: 18px;
+ padding: 0 2px;
+ z-index: 2000;
+ color: #fff;
+ line-height: 1em;
+ }
+ div.olControlZoomPanel .olControlZoomOutItemInactive:after {
+ content: '';
+ line-height: 0.9em;
+ padding: 0 5px;
+ }
+ div.olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
+ display: none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1 id="title">Basic MapBox OSM Example</h1>
+ <div id="tags">mapbox xyz osm</div>
+
+ <div id="shortdesc">Shows how to use MapBox tiles in an OpenLayers map.</div>
+
+ <div id="map" class="smallmap"></div>
+
+ <div id="docs">
+ <p>This example demonstrates the use of an XYZ layer that accesses tiles from MapBox.</p>
+ <p>
+ See the <a href="mapbox.js" target="_blank">mapbox.js</a> source
+ for details. Make sure to read the <a href="http://mapbox.com/tos/">Terms of Service</a>
+ before using MapBox tiles in your application.
+ </p>
+ </div>
+ <script src="../lib/OpenLayers.js"></script>
+ <script src="mapbox.js"></script>
+ </body>
+</html>
View
@@ -0,0 +1,34 @@
+var streets = new OpenLayers.Layer.XYZ(
+ "MapBox Streets",
+ [
+ "http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
+ "http://b.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
+ "http://c.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
+ "http://d.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png"
+ ], {
+ attribution: "Tiles © <a href='http://mapbox.com/'>MapBox</a> | " +
+ "Data © <a href='http://www.openstreetmap.org/'>OpenStreetMap</a> " +
+ "and contributors, CC-BY-SA",
+ sphericalMercator: true,
+ transitionEffect: "resize",
+ buffer: 1,
+ numZoomLevels: 16
+ }
+);
+
+var map = new OpenLayers.Map({
+ div: "map",
+ layers: [streets],
+ controls: [
+ new OpenLayers.Control.Attribution(),
+ new OpenLayers.Control.Navigation({
+ dragPanOptions: {
+ enableKinetic: true
+ }
+ }),
+ new OpenLayers.Control.ZoomPanel(),
+ new OpenLayers.Control.Permalink({anchor: true})
+ ],
+ center: [0, 0],
+ zoom: 1
+});
View
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
- <script src="http://maps.google.com/maps/api/js?v=3.3&amp;sensor=false"></script>
+ <script src="http://maps.google.com/maps/api/js?v=3.6&amp;sensor=false"></script>
<script src="../lib/OpenLayers.js"></script>
<script src="osm-google.js"></script>
</head>
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <title>OpenLayers Grayscale OSM Example</title>
+ <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+ <link rel="stylesheet" href="style.css" type="text/css">
+ <script src="../lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ var map, layer;
+
+ function init() {
+ if (!OpenLayers.CANVAS_SUPPORTED) {
+ var unsupported = OpenLayers.Util.getElement('unsupported');
+ unsupported.innerHTML = 'Your browser does not support canvas, nothing to see here !';
+ }
+
+ layer = new OpenLayers.Layer.OSM('Simple OSM Map', null, {
+ eventListeners: {
+ tileloaded: function(evt) {
+ var ctx = evt.tile.getCanvasContext();
+ if (ctx) {
+ var imgd = ctx.getImageData(0, 0, evt.tile.size.w, evt.tile.size.h);
+ var pix = imgd.data;
+ for (var i = 0, n = pix.length; i < n; i += 4) {
+ pix[i] = pix[i + 1] = pix[i + 2] = (3 * pix[i] + 4 * pix[i + 1] + pix[i + 2]) / 8;
+ }
+ ctx.putImageData(imgd, 0, 0);
+ evt.tile.imgDiv.removeAttribute("crossorigin");
+ evt.tile.imgDiv.src = ctx.canvas.toDataURL();
+ }
+ }
+ }
+ });
+
+ // If you get a security error because the tile are not
+ // from the same domain as this page, a simple Apache
+ // proxy can be created to workaround this issue:
+ //
+ // <Proxy *>
+ // Order deny,allow
+ // Allow from localhost
+ // </Proxy>
+ // ProxyPass /osm http://tile.openstreetmap.org/
+ //
+ // Then, in the layer definition above, replace null with '/osm/${z}/${x}/${y}.png'
+
+ map = new OpenLayers.Map('map', {
+ layers: [layer],
+ zoom: 3,
+ center: [-1081125, 6212801]
+ });
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <h1 id="title">Grayscale OSM Example</h1>
+
+ <div id="tags">
+ openstreetmap canvas grayscale
+ </div>
+
+ <div id="shortdesc">Show an OSM Map in grayscale</div>
+
+ <div id="map" class="smallmap"></div>
+
+ <div id="docs">
+ <p>This example shows an OSM layer where the tiles were
+ converted to grayscale
+ with <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html">canvas</a>.</p>
+ <p style="color:red;" id="unsupported"></p>
+ </div>
+
+ </body>
+</html>
@@ -22,7 +22,7 @@
}
</style>
- <script src="http://maps.google.com/maps/api/js?v=3.5&amp;sensor=false"></script>
+ <script src="http://maps.google.com/maps/api/js?v=3.6&amp;sensor=false"></script>
<script src="../lib/OpenLayers.js"></script>
</head>
Oops, something went wrong.

0 comments on commit 86ccab7

Please sign in to comment.