Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
OL2 versions have long supported WMS - it would be nice to have that functionality added to the Drupal OL3 module. I am beginning some of the coding needed for this, but attached patches are a work in progress for anyone who wants to contribute.
Comment | File | Size | Author |
---|---|---|---|
#11 | openlayers_3x_wms-2475355-10.patch | 6.83 KB | m.stenta |
#7 | Screenshot from 2015-07-23 15:09:24.png | 54.95 KB | m.stenta |
#3 | openlayers_3x_wms-2475355-3.patch | 2.28 KB | m.stenta |
#2 | openlayers_3x_wms-2475355-2.patch | 2.31 KB | m.stenta |
#1 | drupal-2475355-1.patch | 1.82 KB | robertwb |
Comments
Comment #1
robertwb CreditAttribution: robertwb commentedPatch drupal-2475355-1.patch takes small steps towards WMS support in Drupal OL3. This patch:
Image 1
Image 2
Comment #2
m.stentaThanks @robertwb for the initial patch!
I made a few changes. Attached is a new patch (still a work in progress).
Changes:
I will be testing this more soon, and will update the patch as necessary.
Comment #3
m.stentaOops. Previous patch had a console.log() in it.
Here's a clean one...
Comment #4
robertwb CreditAttribution: robertwb commentedAwesome @m.stenta - thanks for picking this up!
Comment #5
m.stenta@robertwd: My pleasure! I need it for my own project anyway. :-)
Question: your original patch used ImageWMS, but I replaced that with TileWMS because that's what I needed. Do you need ImageWMS? If so, it probably won't be hard to extend this patch to add support for it. Basically just copying the files to another new source plugin called "ImageWMS". I've never used ImageWMS sources before, but I'm sure it's relatively similar setup. Here are some links to the two types in Openlayers docs:
http://openlayers.org/en/v3.7.0/apidoc/ol.source.ImageWMS.html
http://openlayers.org/en/v3.7.0/apidoc/ol.source.TileWMS.html
Are you using ImageWMS?
Comment #6
robertwb CreditAttribution: robertwb commentedMy early tests were Images but tiles is obviously the best route to go. Thanks for asking!
Comment #7
m.stentaOK! I feel pretty confident with this patch. I'm going to change this to "Needs Review".
I tested it with the following parameters:
URL: http://services.nationalmap.gov/arcgis/services/transportation/MapServer...
Layers: 1,2,3,4,5,6,7,8,9
Version: (blank so it uses OL default 1.3.0)
Attached is a screenshot of the WMS layer in action! :-)
Comment #8
PolIt would be amazing if we could provide a complete map with a layer and stuff in the Openlayers Examples module.
Comment #9
PolWhat do you think about removing those tests from JS and put them in PHP, in the class ? The methods optionFormValidate() and optionFormSubmit() exists.
We must make sure that what we pass to JS is correct so we speed up things on client side.
Comment #10
robertwb CreditAttribution: robertwb commented> We must make sure that what we pass to JS is correct so we speed up things on client side.
FWIW - I think this is a good idea. The least js the better for module performance as well as insuring that we submit properly formed info to OL.
Comment #11
m.stentaThanks for the input @Pol and @robertwb, attached is a new patch that addresses these things:
Comment #13
PolSuper, that's in :)
Thanks !!!