creating a map using EPSG 31370 leads to the following JS error: "TypeError: this.resolutions is undefined"
Approach:
I defined myself an additional projection EPSG 31370 with following projection definition:
+proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1 +units=m +no_defs
I also completed the projected bounds info in this tab.
Next I defined a WMS layer based on a AGIV WMS service = http://wms.agiv.be/inspire/wms/administratieve_eenheden?
then I tried to configure a map where map and display projection are EPSG 31370. Unfortunately I don't succeed in visualising the map in the Openlayers UI. I tried to define my layer as a baselayer and overlay layer, and I have even added more layers of the same service, still the map is not working.
However, when I configure my WMS layer in another EPSG e.g. the google one, I can perfectly add the WMS service on top of google maps based on the 3857 map and display projection. That works perfect. So it seems a projection issue in the Openlayers UI.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drupalsettings.txt | 14.4 KB | dtirry |
| #4 | layer1.txt | 2.17 KB | dtirry |
| #4 | layer2.txt | 2.18 KB | dtirry |
| #4 | map.txt | 2.54 KB | dtirry |
Comments
Comment #1
polHello Diederik,
Could you post the export of your map and layer please ?
Thanks !
Comment #2
dtirry commentedWhat do you exactly mean? the values of the variables?
Unfortunately, I'm not a professional debugger. Please tell me exactly what info you want.
Comment #3
polWhen you're in admin/structure/openlayers/layers, clic the layer 'export' link.
Same stuff for the map.
Then, post the two files as attachement, see example here: http://drupal.org/node/1958706#comment-7277194
Comment #4
dtirry commentedHere they are.
Comment #5
polThanks, could you also post the
Drupal.settingsJSON from the page source:jQuery.extend(Drupal.settings, {})I will pass it through jsbeautifier.org to read it.
Comment #6
dtirry commentedHere you are.
FYI, I downloaded the openlayers library to have it local.
Diederik
Comment #7
polThanks.
I tried to reproduce it locally without success, the map is blank and Chrome return a JS error:
TypeError: Cannot call method 'getCenterLonLat' of null in
openlayers.js:455Comment #8
augustus.kling commentedThanks a lot for this report.
Due to a change that was mistaking one variable for the other the projection's boundaries have been ignored. The problem should be gone with commit 0c32f4fe07c97eac49fbce3d88dc55688f97c92c and your layer1 displayed fine for me.
I left the
ifof commit ca7161275a62ccece00efa7cb7f9a4cec90f1aa9 even though I don't understand why it's needed. ThemaxExtentgets set inopenlayers_build_mapfor all map configurations somaxExtentis guaranteed to be sensibly set. Is there anything I'm overlooking like the possibility to render maps without callingopenlayers_build_map?Comment #9
polHi all,
Sorry for that, it's my bad, thanks Augustus for spotting it.
The link is about a change on the WMTS layer, not on the map, are you sure this is the good commit ? (there's a small typo in your link, remove the 2 at the end!)
Anyway, to reply to your question, you're perfectly right, as usual.
This is the part who fill in the
maxExtentproperty:And this part cannot be overidden by the user, because
openlayers_build_map()will always be called, so, there's no need to add a check. I just removed it.@Diederik, would you test and report to use if everything's ok ?
@Augustus, many thanks again!
Comment #10
augustus.kling commentedSorry, I copied the wrong commit. The second link should have pointed to 745409a4205726712a5dc26c74297c792da1e9d0 but you figured out what I meant nevertheless.
Comment #11
pol