Hi all,
I would like to include a graticule in the map. I’m using the OL3 2.2 (which uses openlayers 4.6.5 natively).I’ve added this code in the OLMapConnector:
public native final void initGraticule()/*-{
var graticule = new $wnd.ol.Graticule();
graticule.setMap(this);
}-*/;
Calling it after the map is initialized (initMap function in this same class). However, it’s throwing this error in JS:
29VM9047:21 Uncaught TypeError: Cannot read property '0' of null
at jb (eval at injectScript (localhost/:93625), <anonymous>:21:24)
at bc (eval at injectScript (localhost/:93625), <anonymous>:37:37)
at Xk.k.di (eval at injectScript (localhost/:93625), <anonymous>:319:220)
at K.b (eval at injectScript (localhost/:93625), <anonymous>:46:350)
at K.Sc.b (eval at injectScript (localhost/:93625), <anonymous>:49:211)
at lj (eval at injectScript (localhost/:93625), <anonymous>:204:223)
at kj.bh (eval at injectScript (localhost/:93625), <anonymous>:205:476)
at K.k.pq (eval at injectScript (localhost/:93625), <anonymous>:135:287)
at K.eval (eval at injectScript (localhost/:93625), <anonymous>:120:990)
Maybe the map is not yet ready to be included, is it?
Thanks for the help!
Regards,
Ruben