Web-Map-Custom-Element icon indicating copy to clipboard operation
Web-Map-Custom-Element copied to clipboard

Pasting GeoJSON does not work in firefox

Open prushforth opened this issue 2 years ago • 1 comments

To try it, copy this example:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": 1,
      "properties": {
        "ID": 0
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
              [-90,35],
              [-90,30],
              [-85,30],
              [-85,35],
              [-90,35]
          ]
        ]
      }
    }
  ]
}

and paste it here. It works on desktop, and in devtools with a phone simulator enabled, but doesn't work (no error) on firefox on android.

Update: might be due to not being prompted for permission to access the clipboard. On Chrome on android, I was prompted to allow clipboard access, and once granted, the paste worked no problem.

Update 2: Looks like the clipboard API is not yet supported by Firefox

prushforth avatar Apr 10 '23 16:04 prushforth

Yup pasting is not supported by Firefox, though we are able to drag and drop layers, which works in Firefox. https://github.com/Maps4HTML/Web-Map-Custom-Element/blob/fc0c8dad18f7469fb6e551262c0f780f73f11906/src/mapml-viewer.js#L508-L516

AliyanH avatar Apr 17 '23 19:04 AliyanH