• Resolved Oliver Campion

    (@domainsupport)


    We use a custom tile server so that we can geo-fence tiles that are allowed to be viewed on the site (namely France, England and Wales).

    However, if you look at the site and inspect the console, you will see a bunch of tiles that are blocked because they’re outside of the allowed area …

    [Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (admin-ajax.php, line 0)
    https://hofnar.com/wp-admin/admin-ajax.php?action=leaflet_tile&subdomain=b&z=12&x=1321&y=1479

    It is my suspicion that when [leaflet-map fitbounds] is used, the map starts off by loading tiles from a default location?

    If this is true, is there a way to not load any tiles until all the markers have been set first? Loading all these tiles (or not loading them in our case) will be slowing the page load down un-necessarily.

    Thanks,

    Oliver

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Oliver Campion

    (@domainsupport)

    Hi,

    I noticed you pushed a new version today.

    I don’t suppose you have had a chance to look at this have you?

    Thanks,

    Oliver

    Plugin Author bozdoz

    (@bozdoz)

    have not looked at this no.

    I see one shortcode, do you have an alternate one to use with it?

    also just off the top of my head, fitbounds is a JavaScript flag. So what’s likely happening is the map starts at the default zoom and coordinates from your settings page, probably requests those tiles, then once all the shapes are set, it fits the map bounds to those coordinates and redraws the map. Does that help?

    Thread Starter Oliver Campion

    (@domainsupport)

    That’s not quite what’s causing the problem. The map is starting at the default map location (somewhere in Halifax, Canada) which is the main problem, although I can see why zoom would also factor in.

    Unfortunately we cannot change or set the default location because the map is being used dynamically and the default location cannot be determined until fitbounds has fired.

    The reason I’m following up on this is because we have another site (actually we have quite a few) that has the same problem https://mappandluciarye.uk

    I’m not sure what you mean by “I see one shortcode, do you have an alternate one to use with it?” but, can you please let me know if there is a shortcode attribute to prevent the map from loading any tiles until fitbounds has fired?

    This would be beneficial for all users of your plugin that use map shortcodes that don’t immediately state the location and rely on fitbounds because it would prevent unnecessary requests firing off to their tile server which would slow down their page load.

    Thanks,

    Oliver

    Plugin Author bozdoz

    (@bozdoz)

    Thread Starter Oliver Campion

    (@domainsupport)

    OK, great thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Prevent Default Map Tiles’ is closed to new replies.