Ticket #5466: 0001-Use-OSM-tiles-in-Geolocation-plugin-5466.patch

File 0001-Use-OSM-tiles-in-Geolocation-plugin-5466.patch, 1.3 KB (added by Olivier Mehani, 8 years ago)

Patch to replace MapQuest tiles with OSM ones

  • mediagoblin/static/js/geolocation-map.js

    From 83b50de6232727f84c1211d1c4cf9ea299778833 Mon Sep 17 00:00:00 2001
    From: Olivier Mehani <shtrom@ssji.net>
    Date: Wed, 31 Aug 2016 22:20:53 +1000
    Subject: [PATCH] Use OSM tiles in Geolocation plugin #5466
    
    MapQuest recently disabled free-as-in-beer access to their map tiles, so let's
    switch to free-as-in-speech images.
    
    Signed-off-by: Olivier Mehani <shtrom@ssji.net>
    ---
     mediagoblin/static/js/geolocation-map.js | 6 ++----
     1 file changed, 2 insertions(+), 4 deletions(-)
    
    diff --git a/mediagoblin/static/js/geolocation-map.js b/mediagoblin/static/js/geolocation-map.js
    index 26d94c5..c30788f 100644
    a b $(document).ready(function () {  
    3030    // Get a new map instance attached and element with id="tile-map"
    3131    var map = new L.Map('tile-map');
    3232
    33     var mqtileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.jpg';
     33    var mqtileUrl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
    3434    var mqtileAttrib = '<a id="osm_license_link">see map license</a>';
    3535    var mqtile = new L.TileLayer(
    3636        mqtileUrl,
    37         {maxZoom: 18,
    38          attribution: mqtileAttrib,
    39          subdomains: '1234'});
     37        {maxZoom: 18});
    4038
    4139    map.attributionControl.setPrefix('');
    4240    var location = new L.LatLng(latitude, longitude);