[mapserver-users] Issue configuring mapcache
Kenneth Heer
kheer at arkonecall.com
Thu May 31 06:56:34 PDT 2018
Hello,
I'm using mapcache/mapserver/openlayers 3 with ms4w. When my application is loaded with the browser at the normal 100% zoom level, everything returns fine (testing on chrome, firefox, and edge). The map requests are:
mymapcacheserver?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=newlayer&WIDTH=256&HEIGHT=256&CRS=EPSG%3A4326&STYLES=&BBOX=33.75%2C-94.21875%2C35.15625%2C-92.8125
However, some of my users are using the zoom feature of the browser and zooming in to levels greater than 100% or their displays settings on their PCs are set with a scale of greater than 100%.
This changes the height and width values of the web requests so that the height and width are no longer 256 and adds MAP_RESOLUTION=135. The map requests from their browsers are like:
mymapcacheserver?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=newlayer&WIDTH=384&HEIGHT=384&CRS=EPSG%3A4326&STYLES=&MAP_RESOLUTION=135&BBOX=33.75%2C-94.21875%2C35.15625%2C-92.8125
When this happens, only a handful of tiles are returned and mapcache/wms server won't respond to any future web requests from that session. I can pan or zoom over the map, but all generated requests are never fulfilled.
I can change the height and width of the requests in a new/reloaded tab and it returns the appropriate tiles immediately.
A previous version of my application that was using older versions of mapcache/mapserver/openlayers did not have this problem. Other than the version differences, I am now using the predefined grids in mapcache, instead of defining my own.
If I point my layers directly at mapserver, instead of using mapcache, the tiles are returned without issue and work as expected with the updated height/width/map_resolution values.
I understand why the height, width, and map resolution settings are changed with the different scale values, but I'm not sure how to configure my mapcache instance to properly respond. Can anyone point me to where I need to look to resolve this issue?
This is a sanitized version of my mapfile.
<?xml version="1.0" encoding="UTF-8"?>
<mapcache>
<grid name="WGS84">
<metadata>
<title>GoogleCRS84Quad</title>
<WellKnownScaleSet>urn:ogc:def:wkss:OGC:1.0:GoogleCRS84Quad</WellKnownScaleSet>
</metadata>
<extent>-180 -90 180 90</extent>
<srs>EPSG:4326</srs>
<units>dd</units>
<size>256 256</size>
<resolutions>0.703125000000000 0.351562500000000 0.175781250000000 8.78906250000000e-2 4.39453125000000e-2 2.19726562500000e-2 1.09863281250000e-2 5.49316406250000e-3 2.74658203125000e-3 1.37329101562500e-3 6.86645507812500e-4 3.43322753906250e-4 1.71661376953125e-4 8.58306884765625e-5 4.29153442382812e-5 2.14576721191406e-5 1.07288360595703e-5 5.36441802978516e-6</resolutions>
</grid>
<cache name="disk" type="disk">
<base>E:/mapcache/disk</base>
<!--<symlink_blank/>-->
</cache>
<cache name="sqlitecache" type="sqlite3">
<dbfile>E:/mapcache/sqlite/{tileset}.db</dbfile>
<pragma name="max_page_count">10000000</pragma>
</cache>
<source name="statemap" type="wms">
<http>
<url>http://mymapserverurl/fcgi-bin/mapserv.exe?map=/path/to/my/mapfile.map</url<http://mymapserverurl/fcgi-bin/mapserv.exe?map=/path/to/my/mapfile.map%3c/url>>
</http>
<getmap>
<params>
<MAP>d:/path/to/my/mapfile.map</MAP>
<FORMAT>image/png</FORMAT>
<LAYERS>statemap</LAYERS>
</params>
</getmap>
</source>
<!-- Tilesets -->
<!-- Tilesets name must match layer name both from wms & source -->
<tileset name="statemap">
<title>Statemap</title>
<source>statemap</source>
<cache>sqlitecache</cache>
<grid use_wms_intermediate_resolutions="true">WGS84</grid>
<grid>g</grid>
<format>PNG</format>
<metatile>5 5</metatile>
<metabuffer>10</metabuffer>
<expires>2592000</expires>
</tileset>
<!-- settings -->
<default_format>JPEG</default_format>
<format name="PNG_FAST" type="PNG">
<compression>fast</compression>
<colors>256</colors>
</format>
<format name="PNG_BEST" type="PNG">
<compression>best</compression>
</format>
<format name="MIXED" type="MIXED">
<transparent>PNG_BEST</transparent>
<opaque>JPEG</opaque>
</format>
<service type="wms" enabled="true">
<full_wms>assemble</full_wms>
<resample_mode>bilinear</resample_mode>
<format>PNG</format>
</service>
<service type="wmts" enabled="true"/>
<service type="tms" enabled="true"/>
<service type="kml" enabled="true"/>
<service type="gmaps" enabled="false"/>
<service type="ve" enabled="false"/>
<service type="demo" enabled="false"/>
<threaded_fetching>true</threaded_fetching>
<errors>report</errors>
<lock_dir>E:/mapcache/locks</lock_dir>
</mapcache>
Thank You,
Kenneth Heer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20180531/b040f8b8/attachment.htm>
More information about the MapServer-users
mailing list