-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wms? #11
Comments
After looking deeper into the problem: I think that solving this for wms is at least harder, if not impossible. The reason: WMS requests a single image for exactly the bbox representing the map view. So every time the map is panned/zoomed a completely new image is requested, which is taylored for this exact zoom level / view extent. As the number of possible zoom levels and map view extents is huge, it will not be possible to pre-cache the right ones. While in a tiled map every map tile is pre-cached only once, in WMS the same extent (= tile) would have to be pre-cached for every zoom-level and view extent that contains this tile. So basically the needed storage capacity would quickly soar to unreasonable heights. It might be possible to pre-cache wms images and later overlay them as an ImageOverlay though. Maybe a 'do-it-yourself' tiled map could be built this way. Not sure if that is a good idea though. Or even wilder: request wms images for all 256*256 tiles contained in the viewed map and save them as a regular tile layer? Does any of this make sense? |
Very good question! var TileLayerWMSoffline = L.TileLayer.WMS.extend( {
options: {
layers: null, // required - Comma-separated list of WMS layers to show.
styles: null, // Comma-separated list of WMS styles
format: 'image/jpeg', // WMS image format (use 'image/png' for layers with transparency)
transparent: false, // If true, the WMS service will return images with transparency
version: '1.1.1', // Version of the WMS service to use
crs: null, // Coordinate Reference System to use for the WMS requests, defaults to map CRS.
uppercase: false, // If true, WMS request parameter keys will be uppercase
offUrl: null // link to PNG file for missing tile in offline mode
},
dtable: null, // database table to get tiles from
offtest: false, // for simulating offline response
...
L.tileLayer.WMSoffline = function (url, options) { return new TileLayerWMSoffline(url, options); }; Then, the call from index.html will be
As far as I know: |
Thanks a lot for your valued and helpful input. I am building an app that should enable offline data collecting, including mapping. My programming background is web dev, not mapping. I transitioned to web dev more than 10 years ago from environmental science where I spent plenty of time mapping nature myself though. So enabling this is interesting to me. The app has some other challenges too. So I will see how quickly and successfully I can tackle this challenge. |
Does this work with wms?
What would have to be changed?
Not sure if I a up to the challenge: But I may tackle this if you point me out the necessary changes.
The text was updated successfully, but these errors were encountered: