diff --git a/ToWME.js b/ToWME.js index bddba98..89d399c 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 = /&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")) { - 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); }