Skip to content

awikile_h

Bankn8II©$A edited this page Dec 7, 2024 · 9 revisions

https://github.com/aibolem/Leaflet.DistortableImage/wiki/

This wiki is still growing, feel free to participate!

Existing pages so far:

var imageBounds=[

https://www.wrld3d.com/wrld.js/v0.1.1335/docs/leaflet/L.ImageOverlay/

var imageUrl = 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',
    imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
L.imageOverlay(imageUrl, imageBounds).addTo(map);



useEffect(() => {
      if (map && layer) {
        layer.addTo(map);
        layer.setOpacity(0.7);
      }
    }, [layer]);

https://github.com/publiclab/Leaflet.DistortableImage/issues/1391

function imageStyle(){

        return{ opacity:0.5,}   
                }       
var imageBounds=[
 [-22.0,22.5],
 [-26.18,25.452]
 ]
var imageLayer=L.imageOverlay(imageUrl,imageBounds).addTo(map);
//imageLayer.setOpacity( 0.5);
L.imageOverlay(imageUrl, imageBounds, {opacity: 0.5}).addTo(map);

not any code was usefull untill now 20241205 20:47, about default img layer opacity, but like always we will do something ...

https://gis.stackexchange.com/questions/458932/leaflet-image-overlay-align-with-pixel-coordinates-on-map

var imageOverlay = L.imageOverlay(this.imageUrl, this.projectBoundary.getBounds(), {
      opacity: 0.8,
      interactive: true
      }).addTo(this.map);

    var draggableOverlay = new L.Draggable(imageOverlay._image);
      draggableOverlay.enable();

https://github.com/aibolem/Leaflet.DistortableImage/blob/c2bf3def17149735ab5790ae5f4a09fa9be513eb/src/edit/DistortableImage.Edit.js#L294-L303

 _toggleTransparency: function() { 
   var image = this._overlay._image, 
     opacity; 
  
   this._transparent = !this._transparent; 
   opacity = this._transparent ? this.options.opacity : 1; 
  
   L.DomUtil.setOpacity(image, opacity); 
   image.setAttribute("opacity", opacity); 
 }, 

https://github.com/aibolem/Leaflet.DistortableImage/blob/c2bf3def17149735ab5790ae5f4a09fa9be513eb/src/edit/DistortableImage.EditToolbar.js#L12-L26

  ToggleTransparency = EditOverlayAction.extend({ 
    options: { 
      toolbarIcon: { 
        html: '<i class="material-icons md-18">opacity</i>', 
        tooltip: 'Toggle Transparency' 
      } 
    }, 
  
    addHooks: function() { 
      var editing = this._overlay.editing; 
  
      editing._toggleTransparency(); 
      this.disable(); 
    } 
 }), 

https://github.com/Esri/esri-leaflet/issues/747

https://github.com/nwfsc-fram/warehouse/blob/master/server/app/view2/view2.js#L562

And we have a bunch of layers : https://www.nwfsc.noaa.gov/data/map

image

https://aibolem.github.io/Leaflet.DistortableImage/examples/parisel.html

image

Latitude: 48.856301 Longitude: 2.321205

Clone this wiki locally