leaflet-geoserver-request icon indicating copy to clipboard operation
leaflet-geoserver-request copied to clipboard

One issue, two differents messages..

Open vincedchart opened this issue 3 years ago • 2 comments

This is my call to L.Geoserver and I have an issue, with two different messages on Chrome and Geoserver I'm using Leaflet.motion as well

var dataCoords = [];

function doMotion() {
  var seqGroup = L.motion.seq([
    L.motion.polyline(dataCoords, {
    color: "MediumVioletRed",
    weight: 10,
    opacity: 0.8
    }, {
      easing: L.Motion.Ease.easeInOutQuad
    }, {
      removeOnEnd: false,
      icon: L.divIcon({html: "<i class='fa fa-hiking fa-2x' aria-hidden='true'></i>", iconSize: L.point(27.5, 24)})
    }).motionDuration(8000)
  ]).addTo(map);
  seqGroup.on("click", function(){
    seqGroup.motionStart();
  });
  seqGroup.on("dblclick", function(e){
    seqGroup.motionToggle();
  });
  setTimeout(function () {
    seqGroup.motionStart();
  }, 1000);
};



var wfsLayer = L.Geoserver.wfs("https://mappingforyou.eu/geoserver/worldmap/ows", {
 layers: "worldmap:debra",
});


wfsLayer.on('layeradd', function(evt) {
  var coords;
  var geometry = evt.layer.feature.geometry;
  if (geometry.type = 'MultiLineString')
    coords = geometry.coordinates[0];
  else if (geometry.type = 'LineString')
    coords = geometry.coordinates;
  else {
    return;
  }
  coords.forEach(function(coords) {
     dataCoords.push([coords[1], coords[0]]);
  });
  doMotion();
});

Screenshot_22-06-23_11:01:56

Screenshot_22-06-23_11:02:53

vincedchart avatar Jun 23 '22 09:06 vincedchart

In Chrome, the issue happens particularly using https://github.com/KoGor/leaflet-fullHash the plugin that changes the URL

like in https://mappingforyou.eu/italia/#9/45.8231/7.7701/base

but not in https://mappingforyou.eu/italia/

the issue remains in Firefox, which looks different

vincedchart avatar Jun 23 '22 09:06 vincedchart

I suggest you to pass, the fitLayer=false option on the WFS request. You should write,

var wfsLayer = L.Geoserver.wfs("https://mappingforyou.eu/geoserver/worldmap/ows", {
    layers: "worldmap:debra",
    fitLayer: false,
});

iamtekson avatar Jun 23 '22 14:06 iamtekson