我只想在给定的 LatLog 中标记所有医院。我尝试了很多。但是找不到我的错误。
var lat = 12.933;
var lon = 77.612;
var zoom = 13;
var map;
function init() {
map = new OpenLayers.Map("demoMap", {
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.Attribution()
],
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
maxResolution: 156543.0399,
numZoomLevels: 19,
units: 'm',
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
map.addLayer(layerMapnik);
var lonLat = new OpenLayers.LonLat(lon, lat)
.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
map.setCenter(lonLat, zoom);
map.addLayers([
make_layer("http://overpass-api.de/api/interpreter?data=node[amenity=hospital];out+skel;", "red")
]);
}
它没有显示任何结果。这是因为查询错误还是任何其他问题?