Web-Map-Custom-Element
Web-Map-Custom-Element copied to clipboard
Pasting GeoJSON does not work in firefox
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
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