bozdoz / wp-plugin-leaflet-map

Add leaflet maps to Wordpress with shortcodes
https://wordpress.org/plugins/leaflet-map/
GNU General Public License v2.0
140 stars 71 forks source link

Subdomain as array #147

Closed sigg3 closed 1 year ago

sigg3 commented 2 years ago

Does the plugin support subdomain as an array of strings? LeafletJS accepts subdomains as an array, cf. https://leafletjs.com/reference-1.7.1.html#tilelayer

I have a target that is approximately https://{s}.mapdataserv.ext/{x}/{y}/{z}

In this problem case, the subdomains are not single letters but "cache", "cache2" and "cache3".

I have the option of using e.g. subdomains="23" and https://cache{s}.mapdataserv.ext/{x}/{y}/{z}, but this seems to fail. No map is loaded and the console shows an No value provided for variable s error. Even if it worked, it would ignore the "cache" subdomain (no postfix).

Alternatively I can use an array like subdomains=["cache", "cache2", "cache3"], but this currently does not work (breaks the tags). This entails having to set the subdomains in JS, amirite?

How would I proceed to make sure requests span all 3 subdomains?

bozdoz commented 2 years ago

Right. Currently this plugin only accepts the first type for the subdomains property: https://leafletjs.com/reference.html#tilelayer-subdomains which is just a String.

It does not accept String[], but it should.