Browse Source

Ajoute un bonus honteux

master
vincent 2 weeks ago
parent
commit
3e35e21d70
4 changed files with 31 additions and 0 deletions
  1. +12
    -0
      assets/app.js
  2. +10
    -0
      assets/controllers/map_controller.js
  3. +7
    -0
      assets/styles/app.css
  4. +2
    -0
      templates/macro.html.twig

+ 12
- 0
assets/app.js View File

@ -18,3 +18,15 @@ document.addEventListener('click', function (event) {
}
}
});
// /!\ https://wiki.openstreetmap.org/wiki/Google#Google_Maps_terms_of_use
document.addEventListener('keydown', function (event) {
if (event.ctrlKey) {
document.body.classList.add('yolo-balek');
}
}, false);
document.addEventListener('keyup', function (event) {
if (event.key === "Control") {
document.body.classList.remove('yolo-balek');
}
}, false);

+ 10
- 0
assets/controllers/map_controller.js View File

@ -170,4 +170,14 @@ export default class extends Controller {
window.open(url, '_blank');
}
openInMapillary() {
const url = "https://www.mapillary.com/app/?lat="+this.mapInstance.getCenter().lat+"&lng="+this.mapInstance.getCenter().lng+"&z="+this.mapInstance.getZoom();
window.open(url, '_blank');
}
openInGoogleMaps() {
const url = "https://www.google.com/maps/@"+this.mapInstance.getCenter().lat+","+this.mapInstance.getCenter().lng+","+this.mapInstance.getZoom()+"z";
window.open(url, '_blank');
}
}

+ 7
- 0
assets/styles/app.css View File

@ -2,3 +2,10 @@
.min-vh-50 {
min-height: 50vh;
}
.ça-pue-cest-pas-libre {
visibility: hidden;
body.yolo-balek & {
visibility: visible;
}
}

+ 2
- 0
templates/macro.html.twig View File

@ -56,6 +56,8 @@ Où :
Voir sur
<button class="btn btn-sm btn-link" data-action="map#openInOsm">OSM</button>
<button class="btn btn-sm btn-link" data-action="map#openInPanoramax">Panoramax</button>
<button class="btn btn-sm btn-link ça-pue-c’est-pas-libre" data-action="map#openInMapillary">Mapillary</button>
<button class="btn btn-sm btn-link ça-pue-c’est-pas-libre" data-action="map#openInGoogleMaps">Google Maps</button>
</p>
</div>
{% endmacro %}


Loading…
Cancel
Save