Skip to content

Commit

Permalink
Update EnhancedSearch.js
Browse files Browse the repository at this point in the history
  • Loading branch information
justins83 authored Oct 27, 2019
1 parent 4559253 commit 2e82821
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions EnhancedSearch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name WME Enhanced Search
// @namespace https://greasyfork.org/en/users/166843-wazedev
// @version 2019.08.26.02
// @version 2019.10.27.01
// @description Enhances the search box to parse WME PLs and URLs from other maps to move to the location & zoom
// @author WazeDev
// @include https://www.waze.com/editor*
Expand Down Expand Up @@ -277,8 +277,8 @@
WazeWrap.Model.onModelReady(function(){
//Check for selected objects
let selectObjs = [];
if(pasteVal.match(/&segments=(.*)(?:&|$)/)){
let segs = pasteVal.match(/&segments=(.*)(?:&|$)/)[1];
if(pasteVal.match(/&segments=(.*)&|$/)){
let segs = pasteVal.match(/&segments=(.*)&|$/)[1];
segs = segs.split(',');
for(let i=0; i <segs.length; i++)
selectObjs.push(W.model.segments.getObjectById(segs[i]));
Expand All @@ -293,13 +293,16 @@

if(pasteVal.match(/&mapUpdateRequest=(\d*)/)){
let ur = pasteVal.match(/&mapUpdateRequest=(\d*)/)[1];
W.map.updateRequestLayer.featureMarkers[ur].marker.icon.$div[0].click()
debugger;
if(W.map.updateRequestLayer.featureMarkers[ur])
W.map.updateRequestLayer.featureMarkers[ur].marker.icon.$div[0].click()
}

if(pasteVal.match(/&mapProblem=(\d%2[a-zA-Z]\d*)/)){
let mp = pasteVal.match(/&mapProblem=(\d%2[a-zA-Z]\d*)/)[1];
mp = decodeURIComponent(mp);
W.map.problemLayer.markers[mp].icon.$div[0].click();
if(W.map.problemLayer.markers[mp])
W.map.problemLayer.markers[mp].icon.$div[0].click();
}

if(pasteVal.match(/&mapComments=(.*)(?:&|$)/)){
Expand Down

0 comments on commit 2e82821

Please sign in to comment.