mapquest direct tile access discontinued
Asked Answered
L

8

14

As of today 2016-07-11, MapQuest has discontinued direct access to their tiles. They seem to only support Leaflet, iOS and Android SDKs. Any idea how to get Openlayers to work with MapQuest again, or should we be thinking of a different alternative? Thanks.

Lonilonier answered 11/7, 2016 at 20:5 Comment(2)
Did anyone receive any notification prior to shutting down the service??? I am out of words on how to describe this act of professionalismAgrestic
@AnestisKivranoglou I'm like you... suddenly, the map in my app stopped to show the map to the clients... Was really embarasing.Godding
I
3

For basemap imagery with OpenLayers, we are basically down to Bing Maps, Mapbox, and DigitalGlobe. All three services require an API key, and all three offer a free tier.

I'm currently using DigitalGlobe and have been very pleased with their resolution and coverage thus far. To use it in OpenLayers, first sign up for an API key at their site.

http://mapsapidocs.digitalglobe.com/

Then just use the following tile source (remember to replace YOUR_ACCESS_TOKEN):

new ol.layer.Tile({
  title: 'DigitalGlobe Maps API: Recent Imagery with Streets',
  attribution: "© DigitalGlobe, Inc",
  source: new ol.source.XYZ({
            url: 'http://api.tiles.mapbox.com/v4/digitalglobe.nal0mpda/{z}/{x}/{y}.png?access_token=YOUR_ACCESS_TOKEN'
  })
})

This gives you their global satellite imagery with resolutions ranging from a few meters down to 10 centimeters! They offer more base layers than the one I provided in this example, but this should get you started quickly.

For more OpenLayers examples with DigitalGlobe, see this link:

http://mapsapidocs.digitalglobe.com/docs/maps-api-openlayers

Isallobar answered 14/7, 2016 at 22:13 Comment(0)
E
4

It's as simple as changing your tileUrl.

Replace this:

var tileUrl = 'http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png?x'; 

with this:

var tileUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';

Then use as before:

L.tileLayer(tileUrl, {  }).addTo(map);
Encroach answered 14/7, 2016 at 13:40 Comment(2)
I couldn't get tileUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' to work. I was able to get this to work if I used tileUrl = 'http://tile.openstreetmap.org/{z}/{x}/{y}.png'Wandie
Using https://tile.openstreetmap.org/1/1/1.png returns security certificate errors.Wandie
S
3

Use the OSM source:

var osmLayer = new ol.layer.Tile({
    source: new ol.source.OSM()
});

instead of this:

new ol.layer.Tile({
    source: new ol.source.MapQuest({ layer: 'osm' })
});

Works good with OL3.

Spasm answered 12/7, 2016 at 15:3 Comment(0)
R
3

I asked them on their forum. The answer is no, we can't use MapQuest tiles anymore with any other SDK than those provided by MapQuest.

Also, even with MapQuest SDKs, caching / storing data is forbidden, even with a paid account.

The only other option (that I know) if you need a free, unlimited, worldwide map, is Open Street Map. No satellite imagery though, MapQuest was, sadly, the only one (that I know).

If you are ready to pay, you should be able to use MapBox.

EDIT: another fresh new I just got by e-mail from MapQuest team:

actually we don't do the maps anymore, we use Mapbox.
MapQuest is focusing on some mobile and IoT applications, routing and direction engines rather than maps
Rapine answered 13/7, 2016 at 15:40 Comment(0)
I
3

For basemap imagery with OpenLayers, we are basically down to Bing Maps, Mapbox, and DigitalGlobe. All three services require an API key, and all three offer a free tier.

I'm currently using DigitalGlobe and have been very pleased with their resolution and coverage thus far. To use it in OpenLayers, first sign up for an API key at their site.

http://mapsapidocs.digitalglobe.com/

Then just use the following tile source (remember to replace YOUR_ACCESS_TOKEN):

new ol.layer.Tile({
  title: 'DigitalGlobe Maps API: Recent Imagery with Streets',
  attribution: "© DigitalGlobe, Inc",
  source: new ol.source.XYZ({
            url: 'http://api.tiles.mapbox.com/v4/digitalglobe.nal0mpda/{z}/{x}/{y}.png?access_token=YOUR_ACCESS_TOKEN'
  })
})

This gives you their global satellite imagery with resolutions ranging from a few meters down to 10 centimeters! They offer more base layers than the one I provided in this example, but this should get you started quickly.

For more OpenLayers examples with DigitalGlobe, see this link:

http://mapsapidocs.digitalglobe.com/docs/maps-api-openlayers

Isallobar answered 14/7, 2016 at 22:13 Comment(0)
B
2

This problem is happened because.. Direct Access to MapQuest map tiles without a key will end on 11 July 2016. Details on getting keys and SDKs.

for confirmation you can visit following URL

https://lists.openstreetmap.org/pipermail/talk/2016-June/076106.html

Batson answered 12/7, 2016 at 11:30 Comment(0)
L
0

At the moment, I temporarily switched to Bings map as a workaround. Yes, it also requires an api key, but at least it is working with OL3.

Lonilonier answered 11/7, 2016 at 22:34 Comment(0)
A
0

As this question gained popularity for any interested panicked Leaflet users this is a quick solution.

Instead of creating your map Layers through Leaflet directly now you need to Download And Include (Dont forget your key) the MapQuest Leaflet Plugin.

<script src="https://www.mapquestapi.com/sdk/leaflet/v2.2/mq-map.js?key=KEY"></script>

Then you create your map Layer with the MapQuest Plugin

    window.map = L.map('map', {
        center: [50.066, 8.73],
        zoom: 13
        //Or alternatively init layer here  layers:MQ.mapLayer()
    });

    var mapLayer = MQ.mapLayer().addTo(map);

MapQuest Plugin Documentation

Agrestic answered 12/7, 2016 at 9:9 Comment(3)
Any clues on how best to implement the updated mapquest api with the LeafletJS users map? I tried adding the script in your answer (with my own key), but not having much luck.Wandie
We just followed their basic map documentation. developer.mapquest.com/documentation/leaflet-plugins/mapsAgrestic
I ended up using a modified version of another answer.Wandie
S
-3

I switched to ESRI basemap, it works fine.

Make sure you have leaflet referenced:

enter image description here

You can also use world_Street_Map and other ESRI basemaps.

Semirigid answered 14/7, 2016 at 16:39 Comment(1)
Don't use images for code examples. That is not how Stack Exchange works.Wandie

© 2022 - 2024 — McMap. All rights reserved.