| 1 | |
| 2 | = !MapGuide RFC 132 - Fusion OpenLayers upgrade = |
| 3 | |
| 4 | This page contains a change request (RFC) for the !MapGuide Open Source project. |
| 5 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 6 | |
| 7 | == Status == |
| 8 | |
| 9 | ||RFC Template Version||(1.0)|| |
| 10 | ||Submission Date||19 Mar 2013|| |
| 11 | ||Last Modified||19 Mar 2013|| |
| 12 | ||Author||Jackie Ng|| |
| 13 | ||RFC Status||draft|| |
| 14 | ||Implementation Status||completed|| |
| 15 | ||Proposed Milestone||2.6|| |
| 16 | ||Assigned PSC guide(s)||(when determined)|| |
| 17 | ||'''Voting History'''||(vote date)|| |
| 18 | ||+1|||| |
| 19 | ||+0|||| |
| 20 | ||-0|||| |
| 21 | ||-1|||| |
| 22 | ||no vote|| || |
| 23 | |
| 24 | == Overview == |
| 25 | |
| 26 | This RFC proposes to upgrade the OpenLayers in Fusion to the latest stable release (2.12) |
| 27 | |
| 28 | == Motivation == |
| 29 | |
| 30 | Fusion is using a somewhat old version of OpenLayers. |
| 31 | |
| 32 | Upgrading to the latest stable release of OpenLayers (2.12) offers a bunch of useful new features that Fusion can take advantage of: |
| 33 | |
| 34 | * Touch input support, allowing for our Fusion templates to be somewhat serviceable on an Android/iOS phone or tablet device, as swipe and pinch zoom functionality can be leveraged automatically for map panning, zooming and navigation. |
| 35 | * Tile Queues, for improved tile loading. |
| 36 | * New CacheRead and CacheWrite controls for limited client-side caching of tile images. |
| 37 | * Client Zoom, allowing for map tile images to be stretched client-side to fit the current view of the map. This one feature alone presents some new scenarios that previously were not possible, such as the ability to have a Map Definition with dynamic and tiled layers acting as a fully dynamic map that can be zoomed to any arbitrary scale without finite scale restrictions (as tiles will be stretched client-side by OpenLayers). Tiles from commerical layers like OpenStreetMap can also be stretched client-side in such a manner. |
| 38 | |
| 39 | == Proposed Solution == |
| 40 | |
| 41 | Upgrade Fusion's internal copy of OpenLayers to 2.12 |
| 42 | |
| 43 | To improve our audit trail of customizations to OpenLayers and to make future OpenLayers upgrades easier, Fusion-specific modifications to OpenLayers are kept under lib/OpenLayers/ext. Whenever a new built OpenLayers.js needs to be checked in, the files and folders under lib/OpenLayers/ext can be copied into a standard OpenLayers distribution (overwriting any existing files) to be built with our fusion.cfg build configuration file. |
| 44 | |
| 45 | Currently, we are keeping OpenLayers.Util and our implementation of OpenLayers.Layer.MapGuide under this directory. |
| 46 | |
| 47 | The client-zoom feature is controlled by the existing FractionalZoom extension property of the Map widget. |
| 48 | |
| 49 | Under client-zoom the following behaviour occurs (under these examples, OSM is interchangeable with any other grid-based tiled layer): |
| 50 | * MapGuide dynamic layers + OSM (fractionalZoom = true): Map is fully dynamic and OSM tiles are stretched accordingly |
| 51 | * MapGuide dynamic layers + OSM (fractionalZoom = false): Scales "snap" to OSM scales and are stretched accordingly when going below the smallest supported OSM scale. |
| 52 | |
| 53 | The client-zoom feature has no effect if the map has no tiled layers. |
| 54 | |
| 55 | The client-zoom technique does not work in conjunction with Google/Bing layers. See implications |
| 56 | |
| 57 | This implementation work has already been completed on the [http://trac.osgeo.org/fusion/browser/sandbox/ol212 ol212 sandbox branch of Fusion]. Upon adoption of this RFC, the changes will be merged back into Fusion trunk that's automatically linked by our MapGuide Oem tree. |
| 58 | |
| 59 | == Implications == |
| 60 | |
| 61 | The following components in OpenLayers 2.12 are deprecated and we should look at replacing such instances in our core/widget code before another future OpenLayers upgrade: |
| 62 | |
| 63 | * OpenLayers.Class.isPrototype |
| 64 | * OpenLayers.Class.create |
| 65 | * OpenLayers.Class.inherit |
| 66 | * OpenLayers.Util.clearArray |
| 67 | * OpenLayers.Util.setOpacity |
| 68 | * OpenLayers.Util.safeStopPropagation |
| 69 | * OpenLayers.Util.getArgs |
| 70 | * OpenLayers.nullHandler |
| 71 | * OpenLayers.loadURL |
| 72 | * OpenLayers.parseXMLString |
| 73 | * OpenLayers.Ajax.* (all methods) |
| 74 | * OpenLayers.Element.hide |
| 75 | * OpenLayers.Element.show |
| 76 | * OpenLayers.Element.getDimensions |
| 77 | * OpenLayers.Tile.prototype.getBoundsFromBaseLayer |
| 78 | * OpenLayers.Control.MouseDefaults |
| 79 | * OpenLayers.Control.MouseToolbar |
| 80 | * OpenLayers.Layer.Grid.prototype.getGridBounds |
| 81 | * OpenLayers.Format.XML.prototype.concatChildValues |
| 82 | * OpenLayers.Layer.WMS.Post |
| 83 | * OpenLayers.Layer.WMS.Untiled |
| 84 | * OpenLayers.Layer.MapServer.Untiled |
| 85 | * OpenLayers.Tile.WFS |
| 86 | * OpenLayers.Feature.WFS |
| 87 | * OpenLayers.Layer.WFS |
| 88 | * OpenLayers.Layer.VirtualEarth |
| 89 | * OpenLayers.Protocol.SQL |
| 90 | * OpenLayers.Protocol.SQL.Gears |
| 91 | * OpenLayers.Layer.Yahoo |
| 92 | * OpenLayers.Layer.GML |
| 93 | * OpenLayers.Geometry.Rectangle |
| 94 | * OpenLayers.Renderer.NG |
| 95 | * OpenLayers.Renderer.SVG2 |
| 96 | |
| 97 | OpenLayers 2.12 along with the current JxLib presents an issue on Firefox 18+, this is due to the version of MooTools used by JxLib causing "too much recursion" errors under Firefox 18+. As part of this RFC, the MooTools used by JxLib will be upgraded to 1.2.6 |
| 98 | |
| 99 | The OpenLayers client-zoom feature cannot be used with Google and Bing layers as: |
| 100 | |
| 101 | a) These layers aren't Grid-based. Client zoom only works with layers inheriting from OpenLayers.Layer.Grid |
| 102 | |
| 103 | b) Client-side stretching of such tiles constitutes content modification of their tiles and violates the terms of use. |
| 104 | |
| 105 | If we're viewing a map with Google + Bing + OSM and set the FractionalZoom property of the Map widget to true, switching to a Google or Bing layer will disable client-zoom while that layer is active. |
| 106 | |
| 107 | Such limitations should be ideally communicated to the user in the tools/editors department. |
| 108 | |
| 109 | == Test Plan == |
| 110 | |
| 111 | Test and verify our changes on our current suite of supported browsers |
| 112 | |
| 113 | == Funding / Resources == |
| 114 | |
| 115 | Community |