mapquest direct tile access discontinued

女生的网名这么多〃 提交于 2019-11-30 01:19: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.


回答1:


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




回答2:


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);



回答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.




回答4:


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



回答5:


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




回答6:


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.




回答7:


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




回答8:


I switched to ESRI basemap, it works fine.

Make sure you have leaflet referenced:

You can also use world_Street_Map and other ESRI basemaps.



来源:https://stackoverflow.com/questions/38315300/mapquest-direct-tile-access-discontinued

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!