diff --git a/OpenOtherMaps.js b/OpenOtherMaps.js index 6508201..bdab7f2 100644 --- a/OpenOtherMaps.js +++ b/OpenOtherMaps.js @@ -1,7 +1,7 @@ // ==UserScript== // @name WME Open Other Maps // @namespace https://greasyfork.org/users/30701-justins83-waze -// @version 2019.05.30.02 +// @version 2019.06.03.01 // @description Links for opening external resources at the WME location and WME from external resources // @author JustinS83 // @include https://www.waze.com/editor* @@ -25,9 +25,9 @@ // @include http://bridgereports.com/* // @include http://www.deldot.gov/map* // @include https://bagviewer.kadaster.nl/lvbag/bag-viewer/index.html* +// @include http://www.trimarc.org* // @exclude https://www.waze.com/*/user/editor* // @require https://greasyfork.org/scripts/24851-wazewrap/code/WazeWrap.js -// require https://greasyfork.org/scripts/13097-proj4/code/proj4.js // @require https://greasyfork.org/scripts/383120-proj4-wazedev/code/proj4-Wazedev.js // @grant none // @noframes @@ -48,7 +48,7 @@ //var jqUI_CssSrc = GM_getResourceText("jqUI_CSS"); //GM_addStyle(jqUI_CssSrc); - const updateMessage = "Bug fix for WV Weights & Measures"; + const updateMessage = "Adding support for loading WME from trimarc.org"; var settings = {}; var wazerIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAACehJREFUeNrtXOlTVFcWpzJTU/kwf8F8nI8TNSGaVGKWSpllxkQzM2WcSWIq7IsoEhFlXyVgszVKs0QRmi0EBGUxLCLQsi8NzdaA0IhLEhNDAspoghHP3HObfnRLd9PvvdvQpNqqU1Y93rvvnF/fs593HRzW8B8APCUf02zNU0+6ykc0klz1ZIV8ZGJQrp6YJjRDaGGJZug18jftPRoJfYY8i2s4/J7+FY/f/EuuWuOrFXRyNndkAsQQXYOshWvi2hsSlNzp6afl6sl9RJh6IsyiWFBMElkb34HvwnfaPDCl6jt/lqs1AYTh21YDxdTOIu/EdyMPNgdMM8AfiY3wR9ux1sCsBGpiBnlBnmwCnHz11Ktkqw+tNzBG1G8IeVtHdYI/5a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1RGQbPvLA/hhuWeJKwJu6S/iWcVo2KbxyKaT2bipH8CqrAcWmL69MbJFn1K6yiI3Yv+sRw1wNPnzMLDvb7N+kNYv3zeCZZp5okzudomLEMTAgdZkDnwbT1LGZ4wdwg1eEvqw0E0AmGpL/TthOw/GTF4J/xFa0rY1LrTOwTqh92TTEx1gfaWVbErbPVK5K77iayFm1yeEHs+IslJVqqXh4RsC81j9a1l1tD/OkVYtM+TSvkckIdhVY0Wmf8hcUAlSk6dq7WrLDPEC/0yckCcMksBheyA9yySsAr+xwckJ+Hz4qqad4X19AGH0jOmF0HVRZ7dlYboBI7gpczPAFZqjFI7VWDhHiT2LZBiGzph5DmPngrQmZSsJ2SXPD+utM81XSCV3UbbDsQa3QNDDEOltRBMgkDZP2jkD10lf0InpAhzgziJaJbByDgci/41HSZFvBiB+yWFoKjd/TynKFPLOzJKl8dHD3yqGyFN2OyYIt7+NJkSQi87J8InxTWrbjXr74HQhX9FDR0HEyGOPmOAQc29fESEMm1TAHuF1p4P/ckuZQ2gmdV26r3+dR20V3FZAxYyCA5vjyeqBT+WkfITjpY1y1aeKGEYBy+1ANB5IeLaVVBCtk92UPjbAfJWXyKgDYgc2AMTvap6RaXdA1DXMcQxJAcClUy/IoKwhRa+4QUhESECmpU0v8Dm5T0WvAShTX3k2f6iU1T0edjyTonOgchkawrVaohnaj66cHx1VWJ1acI9o9Z7J9DLTD7RNP+QZ39k0z7R71W/6jX/lm4/WAB+9EU9sNNbOlwE/vxOPYDluxHdNnMIW/Yd8PmJKtD3mijcyMf8mZSBQH+sNGOCfw/CkKxncyBj/UAAAAASUVORK5CYII="; @@ -293,8 +293,7 @@ WazeWrap.Interface.AddLayerCheckbox("display", "Google MyMap", true, function(visible){OOMMyMapLayer.setVisibility(visible);}); } - function GetLanguage() - { + function GetLanguage(){ if(isChecked("radOOMNoLang")) return ""; else if(isChecked("radOOMWMELang")) @@ -312,8 +311,7 @@ return new OL.LonLat(lon, lat); } - function LoadMapButtons() - { + function LoadMapButtons(){ $('#OOMMiDrive').remove(); if(settings.MiDrive) { @@ -1136,6 +1134,8 @@ bootstrapGeneral(initDelDOT, 1); else if(location.href.indexOf("http://bridgereports.com") > -1) bootstrapGeneral(initBridgeReports); + else if(location.href.indexOf("http://www.trimarc.org") > -1) + bootstrapGeneral(initTrimarc); /*else if(location.href.indexOf("http://www.511nj.org/trafficmap") > -1){ bootstrapGeneral(initNJ511, 1); }*/ @@ -1280,6 +1280,18 @@ } } + function initTrimarc(){ + let $OOMWazeButton = document.createElement("div"); + $OOMWazeButton.innerHTML = `
`; + + document.getElementById("map-canvas").appendChild($OOMWazeButton); + + document.getElementById("OOMWazeButtonDiv").addEventListener("click", function(){ + let center = map.getCenter(); + window.open(`https://www.waze.com/en-US/editor/?lon=${center.lng()}&lat=${center.lat()}&zoom=${(Math.max(0,Math.min(10,(map.getZoom() - 12))))}`); + }); + } + let isMiss511Loaded = false; function initMississipie511(){ map.addListener('tilesloaded', function() {