The javascript code for the XYZ layer uses options.url and I believe the correct url should be options.base_url. That causes a js error and prevents the map from loading when using this layer type.

The attached patch fixes the issue.

Thanks for the great module.

Comments

ronan’s picture

Oops, patched too soon.

That change breaks the default OSM layers which use 'url' instead of 'base_url'. This patch changes those default layers to 'base_url' for consistency. The two names are used variously amongst the layer types so I'm not sure which is preferred or if there is supposed to be a semantic difference between the two (base_url if it's a url template and url if it's a static url maybe?)

There's another possible bug with the default 'OpenStreetMap 426 hybrid overlay' default layer. The declaration uses 'url' but the WMS layer type uses 'base_layer'. I did not include this in the patch since I haven't actually observed this bug, I just noticed the inconsistency while going through he code.

Let me know if you want me to redo the patch using 'url' instead of 'base_url' or if you want me to make the change to the '426 hybrid overlay' layer.

Thanks again

ronan’s picture

StatusFileSize
new2.26 KB

And the actual patch :)

markabur’s picture

Great, I needed this! :-) Tested and works for my custom XYZ layer.

tmcw’s picture

Status: Needs review » Fixed

Great catch: committed - http://drupal.org/cvs?commit=435712

strk’s picture

I noticed 'OpenStreetMap 426 hybrid overlay' is also using 'url' rather than 'base_url' for a 'layer_type' => 'openlayers_layer_type_wms'
Sounds wrong to me, but didn't test.

strk’s picture

OSM Overlay fixed in http://drupal.org/cvs?commit=440030 (yeah, tested)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

alex_b’s picture

StatusFileSize
new1.74 KB

For convenience, this is a patch rolled against 6.x 2.0-alpha10.