Adds some extra WME functionality related to Google place links.
Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greasyfork.org/scripts/569692/1789860/WME%20Utils%20-%20SDK%20Google%20Link%20Enhancer.js
A utility library for Waze Map Editor scripts: highlights Google Place link issues (closed, broken, duplicate, distant) directly on the map and in the sidebar.
Authors: MapOMatic, karlsosha, JS55CT, WazeDev group License: GNU GPLv3 Latest Version: 2026.03.23.00
This script is a utility library for use by the WME Place Interface Enhancements script.
| Color | Issue | Description |
|---|---|---|
| Red | Permanently closed | Venue closed on Google |
| Yellow | Temporarily closed | Venue temporarily closed on Google |
| Purple | Broken/invalid link | Place ID missing/invalid/not found |
| Orange | Multi-linked | Same Place ID is used by >1 venue |
| Cyan | Too far away | Google/WME place > threshold meters |
| Orange ring/line | Preview line/hover | Appears when hovering links in panel |
Developers: Your main script must:
const GLE = new SDKGoogleLinkEnhancer(sdk, turf, { layerName: '...' });
.enable() to turn on.End users: You do not need to install this directly—WME PIE integrates it for you.
SDKGoogleLinkEnhancer instance.For Script Developers End users: these actions are performed automatically by WME PIE.
Register the layer:
const GLE = new SDKGoogleLinkEnhancer(sdk, turf, { layerName: 'My Script - GLE' });
Optionally localize strings:
GLE.strings.permClosedPlace = I18n.t('pie.GLE.closedPlace');
// etc.
Set the distance warning as desired:
GLE.distanceLimit = 500; // meters
Enable the overlay:
GLE.enable();
Set up user toggle (optional):
checkBoxElement.onchange = () => (GLE.showTempClosedPOIs = checkBoxElement.checked);
⚠️ IMPORTANT: Monkey-Patching To track all Google Place lookups, this script overwrites (monkey-patches)
google.maps.places.PlacesService.prototype.getDetails.If multiple scripts patch this at once, only one will work. (This includes classic Google Link Enhancer scripts and any other similar tool.)
Best practice:
- Use only one script that patches
getDetailsat a time.- SDK-based scripts (that do not modify this function) are compatible.
PlacesService.getDetails).Place.fetchFields, the enhancer will auto-detect and use it.GLE.strings.const GLE = new SDKGoogleLinkEnhancer(sdk, turf, { layerName: 'My Script - GLE' });
| Parameter | Type | Required | Description |
|---|---|---|---|
sdk |
WME SDK object | Yes | The WME SDK instance |
turf |
Turf.js object | Yes | The Turf.js library |
options.layerName |
String | No | Name for the map layer (default: "Google Link Enhancements") |
GLE.strings — All user-facing UI strings. Overwrite individual properties to localize.
GLE.strings.permClosedPlace = 'Permanently closed in Google';
GLE.strings.tempClosedPlace = 'Temporarily closed in Google';
GLE.strings.badLink = 'Invalid Google Place link';
GLE.strings.multiLinked = 'Linked more than once already';
GLE.strings.linkedToXPlaces = 'This is linked to {0} places'; // {0} = count
GLE.strings.tooFar = 'Google place is more than {0} meters away'; // {0} = limit
GLE.strings.linkedToThisPlace = 'Already linked to this place';
GLE.strings.linkedNearby = 'Already linked to a nearby place';
GLE.distanceLimit — Number (meters). Highlights venues whose Google Place marker is farther than this from the WME venue. Area places add the centroid-to-corner distance on top of this threshold.
GLE.distanceLimit = 400; // default
GLE.showTempClosedPOIs — Boolean. When true, shows yellow highlights for temporarily closed venues. Setting this triggers an immediate map redraw.
GLE.showTempClosedPOIs = true; // default
GLE.linkCache — The internal GooglePlaceCache instance. Exposes .cache (Map) and .pendingPromises (Map) for advanced use.
GLE.enable() — Activates the enhancer: installs the API interceptor, starts listening for venue changes, and runs an initial map scan.GLE.disable() — Deactivates the enhancer: removes all map features and event listeners, cancels any pending debounce timer.$('#_cbEnableGLE').change(function () {
if (this.checked) GLE.enable();
else GLE.disable();
$('#_cbGLEShowTempClosed')[0].disabled = !this.checked;
});
Q: Does this script call Google directly? A: No, it uses the editor's loaded Google API via WME's own API key.
Q: Why does it make many Google API requests when I enable it? A: When the highlight layer is visible, it proactively fetches place status for all Google-linked venues in the current viewport so map rings appear without requiring you to click each place. Requests are rate-limited to a maximum of 20 concurrent calls. If the layer is hidden, no proactive fetching occurs.
Q: Can I use several SDK scripts together?
A: Yes, unless another script also monkey-patches getDetails.
Q: Why don't I see highlighting?
A: Your main script may not call .enable(), the highlight layer may be hidden in the Layer panel, or you may be running two GLE-type scripts together.
Q: Do I need an API key? A: No. WME loads all keys and libraries for you.
| Problem | Possible Cause/Solution |
|---|---|
| Highlights missing/broken | Only the last loaded script can patch getDetails. Disable conflicting scripts. |
| Highlights missing after pan | Check that the highlight layer checkbox is enabled in the WME Layers panel. |
| Multiple overlays/flicker | Conflicting scripts — disable all but one GLE/monkey-patched script. |
| No highlights but sidebar colors work | The highlight layer is hidden. Toggle it on in the WME Layers panel. |
| Layer missing | Ensure your code calls the constructor before calling .enable(). |
| Console errors | Please report with a screenshot/log. |