Closed dawnbreak closed 1 year ago
I run into the same question with openlayers 3 - every map has a own JS method there.. I think best would be to add a javascript field for every library, e.g. javascript_openlayers, javascript_leaflet and javascript_openlayers3
I don't know yet what will makes most sense. I also haven't looked in OL3 yet how it is there. Any idea how to solve the layer options like attribution, maxZoom, minZoom, etc. which should exist for most libraries or how to merge these with own attributes I might want to set for my layers or just specific to some types? Or do we remove them and put them directly in the JavaScript also for every library?
Please take a look at the bing layer: new OpenLayers.Layer.Bing({name:\'###TITLE###\',key:\'###STATIC_SCRIPT###\',type:\'Road\'}) I've used markers, the first one is from the FE plugin, the second one from TS You can add maxZoom and minZoom in this database field, because it is a fix value for this entry.
Can you please checkout my last commit and check if this works for you?
Yes, that will work for me. Is it in purpose that there is no default TypoScript functionality for this static_script replacement?
No, it was a simple workaround for the google api key ... feel free to implement some better TS integration :-)
I need to add a WMS base layer in Leaflet. For OpenLayers I can add a layer and just put the needed WMS JavaScript in the JavaScript field for the layer like: new OpenLayers.Layer.WMS('###TITLE###', "https://server.example/MapServer/WMSServer", {layers: "0,1"}) When I choose Leaflet in the frontend plugin this is not possible, because it does not include the JavaScript field and requires a tile server, otherwise I even can't select it as a base layer.
What would be your idea how to implement it? Should we just tweak the layer generation for Leaflet to also include the JavaScript like in OpenLayers? Then the code in the layer would be library dependent, or should we extend the layers with a switch and options for the different base layer types?