WME Fix Map Object

Temporary fix for the changes made in the WME internal data structure that breaks any script that interacts with the map

目前為 2019-10-31 提交的版本,檢視 最新版本

// ==UserScript==
// @name        WME Fix Map Object
// @namespace   http://www.tomputtemans.com/
// @description Temporary fix for the changes made in the WME internal data structure that breaks any script that interacts with the map
// @include     /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor.*$/
// @version     0.0.1
// @grant       none
// ==/UserScript==

/* global W */

(function() {
    'use strict';

    function init() {
        if (typeof W === 'undefined' ||
            typeof W.map === 'undefined' ||
            typeof W.map.olMap === 'undefined') {
            setTimeout(init, 100);
            return;
        }
        // Go through all properties, including the prototype chain
        for (var mapProperty in W.map.olMap) {
            if (!W.map[mapProperty]) {
                W.map[mapProperty] = W.map.olMap[mapProperty];
            }
        }
    }

    init();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址