Glodenox / wme-image-overlays

A userscript that allows Waze editors to overlay a local image onto the map in the background
GNU General Public License v3.0
4 stars 1 forks source link

Waze Editor bug? (this.setLayerZIndex is not a function) #14

Closed MarcHagen closed 4 years ago

MarcHagen commented 4 years ago
vendor-93d30041d65a17892c34.js:1 Uncaught TypeError: this.setLayerZIndex is not a function
    at t.setLayerIndex (vendor-93d30041d65a17892c34.js:1)
    at HTMLImageElement.eval (userscript.html?id=919394a0-b527-4027-844c-2ad4bb8addeb:781)

And the "formatted" code from vendor.js:

        setLayerIndex: function(e, t) {
            var n = this.getLayerIndex(e);
            if (t < 0 ? t = 0 : t > this.layers.length && (t = this.layers.length),
            n != t) {
                this.layers.splice(n, 1),
                this.layers.splice(t, 0, e);
                for (var r = 0, i = this.layers.length; r < i; r++)
                    this.setLayerZIndex(this.layers[r], r); << Broken
                this.events.triggerEvent("changelayer", {
                    layer: e,
                    property: "order"
                }),
                this.allOverlays && (0 === t ? this.setBaseLayer(e) : this.baseLayer !== this.layers[0] && this.setBaseLayer(this.layers[0]))
            }
        },
Glodenox commented 4 years ago

Hey, I'm aware of this issue. It is caused by an update that Waze pushed way sooner than I had expected.

As a temporary workaround, you could install this small userscript that counteracts the changes made by Waze. It will also help with all other userscripts.

MarcHagen commented 4 years ago

Hey, I'm aware of this issue. It is caused by an update that Waze pushed way sooner than I had expected.

As a temporary workaround, you could install this small userscript that counteracts the changes made by Waze. It will also help with all other userscripts.

Perfect, thanks for the temporary workaround.

Glodenox commented 4 years ago

This issue has been fixed with the recent release :)