From 02c0b39c8d20236c54ae0d8a43453a475acece37 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Thu, 31 Aug 2017 10:08:29 -0500 Subject: [PATCH 1/2] Waze->Drive Texas I added a two way jump to the DriveTexas.org website. This aided myself quite a bit during the Hurricane Harvey issues. Feel free to incorporate this if you like, or improve, or dump it, its all you. Thanks for what you do. turnertr, OK/TX SM --- ToWME.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ToWME.js b/ToWME.js index bddba98..ee1a128 100644 --- a/ToWME.js +++ b/ToWME.js @@ -17,12 +17,16 @@ javascript: (function() { mZoom = (mZoom > 11 ? 10 : mZoom); mOut = 'https://www.waze.com/editor/?env=usa&lon=' + mRes[3] + '&lat=' + mRes[2] + '&zoom=' + mZoom + '&mode=0'; } + } else if (~mURL.toLowerCase().indexOf("waze.com")) { + var mReg = /\/editor\/\?env=usa&lon=(-?\d+\.?\d+)&lat=(-?\d+\.?\d+)&zoom=(\d{1,2})&segments=/i; + var mRes = mReg.exec(mURL); + mOut = 'https://drivetexas.org/#/15/' + mRes[2] + '/' + mRes[1] ; } else if (~mURL.toLowerCase().indexOf("i35-maps.tti.tamu.edu")) { - var mapCenter = TTI.mapGuru.map.getCenter(); - var mZoom = TTI.mapGuru.map.getZoom(); - mZoom = (mZoom < 11 ? 11 : mZoom) - 11; - mOut = 'https://www.waze.com/editor/?env=usa&lon=' + mapCenter.longitude + '&lat=' + mapCenter.latitude + '&zoom=' + mZoom; - } + var mapCenter = TTI.mapGuru.map.getCenter(); + var mZoom = TTI.mapGuru.map.getZoom(); + mZoom = (mZoom < 11 ? 11 : mZoom) - 11; + mOut = 'https://www.waze.com/editor/?env=usa&lon=' + mapCenter.longitude + '&lat=' + mapCenter.latitude + '&zoom=' + mZoom; + } if (mOut !== null) { window.open(mOut); } From 44fd4d2451271d67af6752f4cd7a6a5756fd1c88 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Thu, 7 Sep 2017 11:48:47 -0500 Subject: [PATCH 2/2] Update ToWME.js --- ToWME.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ToWME.js b/ToWME.js index ee1a128..89d399c 100644 --- a/ToWME.js +++ b/ToWME.js @@ -18,7 +18,7 @@ javascript: (function() { mOut = 'https://www.waze.com/editor/?env=usa&lon=' + mRes[3] + '&lat=' + mRes[2] + '&zoom=' + mZoom + '&mode=0'; } } else if (~mURL.toLowerCase().indexOf("waze.com")) { - var mReg = /\/editor\/\?env=usa&lon=(-?\d+\.?\d+)&lat=(-?\d+\.?\d+)&zoom=(\d{1,2})&segments=/i; + var mReg = /&lon=(-?\d+\.?\d+)&lat=(-?\d+\.?\d+)&/i; var mRes = mReg.exec(mURL); mOut = 'https://drivetexas.org/#/15/' + mRes[2] + '/' + mRes[1] ; } else if (~mURL.toLowerCase().indexOf("i35-maps.tti.tamu.edu")) {