我想导出OSM地图(距离OSM地图很小的区域,可能是2 x 2 km),并带有诸如缩放级别等所有选项。我已经尝试过josm-tested.jar。我正在将数据导出为osm格式,也可以从网站OSM
下载此类文件但是现在,我怎么可能将此地图用作本地脱机服务器?
我需要采取一些措施。 只需此html代码即可在线显示osm映射,并向其中添加一些标记..
<html>
<body>
<div id="mapdiv"></div>
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script>
map = new OpenLayers.Map("mapdiv");
map.addLayer(new OpenLayers.Layer.OSM());
var lonLat = new OpenLayers.LonLat(-0.1279688, 51.5077286)
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
);
var zoom = 16;
var markers = new OpenLayers.Layer.Markers("Markers");
map.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(lonLat));
map.setCenter(lonLat, zoom);
</script>
</body>
</html>