Hi,
I’ve turned Bart’s html page in a GeoServer template and added browser
detection logic as suggested by Ian, the result can be found here:
https://github.com/aaime/geoserver/tree/ol3
and in particular:
https://github.com/aaime/geoserver/commit/f2993154c610f52d3484dcc1474cc7a2796532ac
On the brigth side, the browser detection appears to work (I have a IE7 in XP)
and the preview feels snappier, there are a few gotchas:
- when loading the page the following error appears in the javascript console:
Uncaught TypeError: Object # has no method ‘b’ , ol.js 297
This happens regardless of whether I use the compressed version available online,
or one that I built locally, but if I use an uncompressed version instead I get:
-
Uncaught Error: unimplemented abstract method ol-whitespace.js:133
-
goog.abstractMethodol-whitespace.js:133
-
ol.control.ScaleLine.updateElement_ol-whitespace.js:27160
-
ol.control.ScaleLine.handleMapPostrenderol-whitespace.js:27140
-
goog.events.EventTarget.fireListenersol-whitespace.js:8467
-
goog.events.EventTarget.dispatchEventInternal_ol-whitespace.js:8511
-
goog.events.EventTarget.dispatchEventol-whitespace.js:8426
-
ol.Map.renderFrame_ol-whitespace.js:26429
-
goog.async.AnimationDelay.doAction_ol-whitespace.js:14079
-
goog.async.AnimationDelay.fireol-whitespace.js:14064
-
ol.Map.renderol-whitespace.js:26333
-
ol.Map.handleViewPropertyChanged_ol-whitespace.js:26290
-
goog.events.EventTarget.fireListenersol-whitespace.js:8467
-
goog.events.EventTarget.dispatchEventInternal_ol-whitespace.js:8511
-
goog.events.EventTarget.dispatchEventol-whitespace.js:8426
-
ol.Object.notifyInternal_ol-whitespace.js:8688
-
ol.Object.setol-whitespace.js:8707
-
ol.View2D.setResolutionol-whitespace.js:17301
-
ol.View2D.fitExtentol-whitespace.js:17286
-
(anonymous function)
Now… I guess the above might be due to me having to define a custom projection object for the data, following this example (http://ol3js.org/en/master/examples/wms-no-proj.html), in order to have the preview work at all when using pretty much anything but 4326 and 3857.
I don’t know how to fix it though.
- GetFeatureInfo simply does not work, it seems the event that would trigger it is just not raised
- I noticed that the DPI is not overridden in this version, does this mean OL now uses the OGC suggested value?
I’ve attached a couple of samples for reference (in the sample ol.js is loaded from the web site, but the line above can be changed to fetch the OL sources from the local geoserver instead… it was me trying to debug the two above issues, forgot to change it back).
Cheers
Andrea
–
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
(attachments)
tiger-ny.html (14.6 KB)
spearfish.html (14.7 KB)