Skip to content

Commit

Permalink
Slightly improved map query response handling
Browse files Browse the repository at this point in the history
Fixed TamperMonkey notices about accessing external resources
  • Loading branch information
Glodenox committed Apr 4, 2016
1 parent 3fdad8b commit e1f7c66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It is also possible to adjust the visibility of these maps within the usual laye

## Installation instructions

> TL;DR: install as most other WME userscripts from its [Greasy Fork page](https://greasyfork.org/scripts/13334-wme-openmaps)
> TL;DR: install as most other WME userscripts from its Greasy Fork page: [INSTALL OPEN MAPS](https://greasyfork.org/scripts/13334-wme-openmaps)
Userscripts are snippets of code that are executed after the loading of certain webpages. This script does this after the loading of the Waze Map Editor. In order to run userscripts in your browser, you are adviced to use Firefox or Google Chrome.

Expand Down
29 changes: 20 additions & 9 deletions WME_OpenMaps.user.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
// ==UserScript==
// @name WME OpenMaps
// @author Tom 'Glodenox' Puttemans
// @namespace http://www.tomputtemans.com/
// @description Add additional maps that are released as open data to the Waze Map Editor
// @include https://www.waze.com/*/editor/*
// @include https://www.waze.com/editor/*
// @include https://editor-beta.waze.com/*
// @exclude https://www.waze.com/user/*editor/*
// @connect wallonie.be
// @connect informatievlaanderen.be
// @connect agiv.be
// @connect irisnet.be
// @connect nationaalgeoregister.nl
// @connect gbo-provincies.nl
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AEJDjg3P0Tj5gAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAXn0lEQVRo3r2aebAnVZXnP+fm8tveVq9e7cVSFKLQIKGDhNjR2j2tBkyr0Ztbqz3hhtjd44qCOi49jt2g4O6AaKPtODo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stmf/A3+utdOrvM/v+KEZKb9RCdckDp5gkNm6pTEEFPMOcwlmCR1OV7GCw02SVucRmgWI9U5VBwx2PejyhdipTeUtxz+Bt+7vADY+eX/ydGXXwe3v+M3tJl093OYuvgp9C9+6iboZ1+xO+llZzgn57qExzkn50jqFhz1kpNgONv0opvLylIDioYFu0OjfSNG+yeL+i/VHYt32jfeMpx09JxLsH++/De/x7nelfNMuhf9AcM3P3uz7Xde02o9ZGE7zi3gdV+SudMkkVPEyR5EZusZOIrZ0MyWLNohreKdBj8hcUd04I/5T1yyctx3Hv4K+Je3///bwH28rp5P8levJb7jsT9zyz3xDXm6YyqTLEmxmOASh5kRg5m5YKPo/Y13Vqx8KP7Mw/ueD4f/7tfq2v8BYnxlct8rPiYAAAAASUVORK5CYII=
// @version 2.3.4
// @supportURL https://github.com/Glodenox/wme-om/issues
// @version 2.3.5
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
Expand Down Expand Up @@ -40,7 +48,7 @@
return;
}

var versions = ['2.3.0', '2.3.1', '2.3.2', '2.3.3', '2.3.4'];
var versions = ['2.3.0', '2.3.1', '2.3.2', '2.3.3', '2.3.4', '2.3.5'];
// set up language string
var om_strings = {
en: {
Expand Down Expand Up @@ -77,7 +85,8 @@
v2_3_1: '- Fixes loading and saving of map state\n- Fixed some bugs concerning map ordering\n- Gray background added to map loading indicator\n- Adjusted BAG map queryability',
v2_3_2: '- Fixes bug where removing a map also internally removed the maps below\n- Layer querying will only now only take place on visible queryable layers\n- Small changes to boundary and querying options in some maps',
v2_3_3: '- Fixes to map layer reordering',
v2_3_4: '- Small UI improvements and internal code refactoring'
v2_3_4: '- Small UI improvements and internal code refactoring',
v2_3_5: '- Slightly improved map query response handling\n- Fixed TamperMonkey notices about accessing external resources'
}
},
nl: {
Expand Down Expand Up @@ -114,7 +123,8 @@
v2_3_1: '- Het inladen en opslagen van de kaarten is opgelost\n- Enkele bugs geplet rond het ordenen van kaarten\n- Een grijze achtergrond toegevoegd aan de laadindicator voor kaarten\n- De doorzoakbaarheid van de BAG-kaart is aangepast',
v2_3_2: '- Probleem opgelost waarbij het verwijderen van een kaart alle onderliggende kaarten ook verwijderde\n- Het bevragen van een kaart gebeurt nu enkel op zichtbare bevraagbare lagen\n- Kleine veranderingen aan de grenzen en bevragingsinstellingen van sommige kaarten',
v2_3_3: '- Het verplaatsen van lagen van een kaart is hersteld',
v2_3_4: '- Kleine veranderingen aan de UI en interne herwerking van code'
v2_3_4: '- Kleine veranderingen aan de UI en interne herwerking van code',
v2_3_5: '- Licht verbeterde verwerking van kaartopzoekingen\n- Probleem opgelost met TamperMonkey-meldingen over het gebruik van externe bronnen'
}
},
fr: {
Expand Down Expand Up @@ -341,7 +351,8 @@
unwantedNodes[i].parentNode.removeChild(unwantedNodes[i]);
}
var body = response.responseXML.querySelector('body');
if (body) {
var content = body.textContent.trim();
if (body && content.length != 0) {
removeUnsafeAttributes(body);
queryWindowContent.innerHTML = body.innerHTML;
queryWindow.style.display = 'block';
Expand Down Expand Up @@ -799,16 +810,16 @@
editContainer.appendChild(opacityLabel);
var opacitySlider = document.createElement('input');
opacitySlider.type = 'range';
opacitySlider.max = 100;
opacitySlider.min = 5;
opacitySlider.step = 5;
opacitySlider.max = 100;
opacitySlider.min = 5;
opacitySlider.step = 5;
opacitySlider.value = this.opacity;
opacitySlider.style.verticalAlign = 'middle';
opacitySlider.addEventListener('input', function() {
self.layer.setOpacity(this.value / 100);
self.opacity = this.value;
saveMapState();
});
});
editContainer.appendChild(opacitySlider);
if (map.format != 'image/jpeg') {
var transparentContainer = document.createElement('div');
Expand Down

0 comments on commit e1f7c66

Please sign in to comment.