In the settings / global settings there’s an option ‘Unrestricted Pan’ which controls who is allowed to pan away from centre. If you set that to ‘No one’ then your users will not be able to pan away to a different area. It allows you to pan by 40% of the width/height of the map in any direction to give a little leeway, but that’s not a great number of additional tiles.
In reality the tile limit from OS is quite high (about 2,000,000 per month) so unless you have a high number of site visitors abusing your maps then you’re unlikely to hit the limit.
Thread Starter
Al S
(@scoc)
Thanks for the swift help. I’m coming up with another problem. When I first load a page the map displays, but when I refresh it disappears.
At:
https://wordpress-144212-2607914.cloudwaysapps.com/all-activities/
I am using it as a shortcode in a custom post type (Toolset) field and getting this error on refresh when the map doesn’t display:
DevTools failed to load source map: Could not load content for http://localhost:9000/script_v2021.2.16.js.map: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for http://localhost:9000/script_device_v2021.2.16.js.map: Connection error: net::ERR_CONNECTION_REFUSED
The warning messages you posted are nothing to do with the OS maps plugin. They appear when the 3D viewer starts so I suspect they may be related to that.
The reason the map doesn’t appear on that page is that the Javascript files which the plugin adds to the WordPress output queue are not actually being sent. My best guess is that some other plugin is interfering with the way WordPress works. WP Views maybe?
The plugin appears to be working fine on your demo page without those other items.
Thread Starter
Al S
(@scoc)
Great thanks for the help 🙂
Thread Starter
Al S
(@scoc)
Hello.
I disabled a 360 view iframe and now see no errors in the console. However, Toolset is still not displaying the shortcode of the map. There is a version here: https://wordpress-144212-2607914.cloudwaysapps.com/demo/
Which is not contained within a view as a shortcode and can easily be seen and refreshed.
It seems only to be a problem when contained as a shortcode in a view here as already described and shown in the previous image:
https://wordpress-144212-2607914.cloudwaysapps.com/all-activities
I received this from Toolset Tech Support
Even I do not see the map is loaded on first load, you need to check with the “os-datahub-maps” plugin author what is missing in this case as Toolset’s role is to display the value that you added to field. Does it require any dependencies all those answers should be known to plugin author. Would you mind to check with plugin author and if there is issue with Toolset and Toolset is involved we are happy to help based on direction given by your plugin author.
It appears that the scripts which os-datahub-maps requires are not being output when used within a Toolset view.
The plugin registers all the scripts it needs on init using wp_register_script, but does not enqueue them. When the shortcode is parsed it creates a list of the scripts actually used, and the scripts in this list are then output using wp_print_scripts by the wp_footer hook. If the shortcode parsing is being delayed until after wp_footer has fired then the list will be empty and no scripts will be output.
The reason the scripts are enqueued only when the shortcode is used is to prevent conflicts with other plugins which also use Leaflet maps. If two plugins enqueue the scripts for Leaflet, especially different versions of Leaflet, then neither of them works properly.
Thread Starter
Al S
(@scoc)
This has now been resolved. Thanks for all your support. The issue was Toolset’s Views Cache:
I just disabled the view’s cache as you can see with the following screenshot:
=> https://nimb.ws/aYHDtg