admin管理员组文章数量:1301542
I am using a leaflet map in program with the following code:
<style>
<link rel="stylesheet" href="/[email protected]/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
@import url(//cdnjs.cloudflare/ajax/libs/leaflet/0.7.2/leaflet.css);
#map {
width: 960px;
height: 500px;
}
</style>
<body>
<div id="map"/>
<script type="text/javascript">
var osmUrl = 'http://{s}.tile.openstreetmap/{z}/{x}/{y}.png',
osmAttrib = '© <a href="">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 20, attribution: osmAttrib});
var map = L.map('map').setView([37.5, -115], 6).addLayer(osm);
</body>
However, I keep seeing some grey square on my maps at random positions and I get the following Leaflet error code in the javascript console:
.png 504 (Gateway Timeout)
Would anyone know what's wrong and how to solve it?
I am using a leaflet map in program with the following code:
<style>
<link rel="stylesheet" href="https://unpkg./[email protected]/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
@import url(//cdnjs.cloudflare./ajax/libs/leaflet/0.7.2/leaflet.css);
#map {
width: 960px;
height: 500px;
}
</style>
<body>
<div id="map"/>
<script type="text/javascript">
var osmUrl = 'http://{s}.tile.openstreetmap/{z}/{x}/{y}.png',
osmAttrib = '© <a href="http://openstreetmap/copyright">OpenStreetMap</a> contributors',
osm = L.tileLayer(osmUrl, {maxZoom: 20, attribution: osmAttrib});
var map = L.map('map').setView([37.5, -115], 6).addLayer(osm);
</body>
However, I keep seeing some grey square on my maps at random positions and I get the following Leaflet error code in the javascript console:
http://a.tile.openstreetmap/6/8/25.png 504 (Gateway Timeout)
Would anyone know what's wrong and how to solve it?
Share edited Jun 8, 2018 at 9:52 LBes asked Jun 8, 2018 at 9:30 LBesLBes 3,4562 gold badges37 silver badges71 bronze badges 2- I've seen several similar reports lately. It's the OSM server returning an error, not leaflet or your code. Suggest following up in an OSM forum. – peeebeee Commented Jun 8, 2018 at 9:48
- 1 Ok I should probably edit my question then (so it shows up on google) and take it to an OSM forum! – LBes Commented Jun 8, 2018 at 9:49
1 Answer
Reset to default 12A 50x error from the OpenStreetMap tile servers is a problem caused on the OSM side of things, not a problem caused by your use (or misuse) of OSM tiles in your website or application.
Judging by the specific time and date of your question, I'll make a wild assumption and say that you were hitting one of the squid proxy servers during a momentary overload of the network while a system-wide upgrade from squid 2 to squid 3 has been going on for the past few days (note the screenshot below is for the git repo holding the chef devops recipes for the OSM servers, and also the fact that I can see the status of the OSM servers is awesome).
Please keep in mind that the OSM tile servers and proxy servers are maintained by a team of (awesome) volunteer system administrators and, while they do their best to keep everything up and running, the OSM Foundation can not make any guarantees about the quality of service.
Read more about this at https://operations.osmfoundation/ and specifically at https://operations.osmfoundation/policies/tiles/
Would anyone know what's wrong and how to solve it?
In general, temporarily failures of the OSMF services can be solved by:
- Having patience and waiting for the sysadmins to fix things.
- Lurking at the OFTC #OSM-dev IRC channel (more info here) to know specifically what's wrong and politely asking. If you do so, do not be a nuisance to the people there; it will only slow things down.
- Donating money to the OSMF so it can increase its operational capabilities.
- Volunteering to be a part of the OSMF Operations Working Group, or contributing with hardware for mirror servers or the like.
If you do not want to be bound by the limitations of the OSMF, there are a couple mon alternatives:
- Use a mercial tile provider (some of the providers are listed here)
- Host your own tiles (more information here)
- Cache the tiles. Unlike most mercial vendors, OSM allows you to store, proxy, and cache the tiles in pretty much whatever way you want. In fact, anything that will lessen the load on the OSMF servers is encouraged, as long as you take a modicum of care (i.e. do not seed your cache, which would trigger bulk downloads).
本文标签: javascriptOpenStreetMap often sends Gateway Timeout errorStack Overflow
版权声明:本文标题:javascript - OpenStreetMap often sends Gateway Timeout error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741674805a2391819.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论