[Geoserver-devel] OL3 preview, status update

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:

  1. Uncaught Error: unimplemented abstract method ol-whitespace.js:133

  2. goog.abstractMethodol-whitespace.js:133

  3. ol.control.ScaleLine.updateElement_ol-whitespace.js:27160

  4. ol.control.ScaleLine.handleMapPostrenderol-whitespace.js:27140

  5. goog.events.EventTarget.fireListenersol-whitespace.js:8467

  6. goog.events.EventTarget.dispatchEventInternal_ol-whitespace.js:8511

  7. goog.events.EventTarget.dispatchEventol-whitespace.js:8426

  8. ol.Map.renderFrame_ol-whitespace.js:26429

  9. goog.async.AnimationDelay.doAction_ol-whitespace.js:14079

  10. goog.async.AnimationDelay.fireol-whitespace.js:14064

  11. ol.Map.renderol-whitespace.js:26333

  12. ol.Map.handleViewPropertyChanged_ol-whitespace.js:26290

  13. goog.events.EventTarget.fireListenersol-whitespace.js:8467

  14. goog.events.EventTarget.dispatchEventInternal_ol-whitespace.js:8511

  15. goog.events.EventTarget.dispatchEventol-whitespace.js:8426

  16. ol.Object.notifyInternal_ol-whitespace.js:8688

  17. ol.Object.setol-whitespace.js:8707

  18. ol.View2D.setResolutionol-whitespace.js:17301

  19. ol.View2D.fitExtentol-whitespace.js:17286

  20. (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)

On Sun, Jan 12, 2014 at 7:11 PM, Bart van den Eijnden <
bartvde@anonymised.com> wrote:

Hey Andrea,

what is the easiest way for me to test with your data? Can you send a shp
and the resulting html?

You just need a vanilla GeoServer installation (e.g., the community one,
not the OpenGeo suite one),
the examples I've sent are using two sample layers.

I guessing we'll need proj4js in the mix.

Urgh... is there no way to avoid the extra dependency? OL3 is already
almost twice as big as our OL2
build.
Anyways... if we can't, we can't.

ol3 has no DPI setting anymore.

I see, thanks

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

-------------------------------------------------------

On Mon, Jan 13, 2014 at 11:41 AM, Bart van den Eijnden <
bartvde@anonymised.com> wrote:

Hey Andrea,

I talked this over with Andreas just now. Apparently the scale bar / scale
line in ol3 will need proj4js for anything else than WGS84 or Google Web
Mercator.

Andreas said the scale calculation in OpenLayers 2 was inaccurate anyway.

So does it make sense to remove the scale bar from the preview app instead?

Hmm... the scale bar it not that useful, but a scale denominator would be,
very much, since people are going to use it to check
their SLD/CSS scale dependent rules

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

-------------------------------------------------------