瓷砖投影错误? (mbtiles mbutil openlayers.tms)
我在进行瓷砖厂项目时遇到了问题 到我的网络服务器并使用 OpenLayers 进行绘制 我的地图。
我们正在使用tilemill来设计地图> mbtiles 出口> mbutil 到目录> openlayers.tms
我已在下面附上我们正在使用的代码, 这是 OpenLayers.TMS 的修改版 例子。
这是我的地图的链接,您将看到 问题,第一手资料:
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers Tiled Map Service Example</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 0;
var lat = 0;
var zoom = 0;
var map, layer;
function init(){
OpenLayers.ImgPath = "http://js.mapbox.com/theme/dark/";
map = new OpenLayers.Map( 'map', {maxResolution:1.40625/2} );
layer = new OpenLayers.Layer.TMS( "ttc",
"http://wrimaptube.nfshost.com/ttctiles3/", {layername: 'ttc3', type:'png'} );
map.addLayer(layer);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
function addTMS() {
l = new OpenLayers.Layer.TMS(
OpenLayers.Util.getElement('layer').value,
OpenLayers.Util.getElement('url').value,
{
'layername': OpenLayers.Util.getElement('layer').value,
'type': OpenLayers.Util.getElement('type').value
});
map.addLayer(l);
map.setBaseLayer(l);
}
</script>
</head>
<body onload="init()">
<div id="map" style='width: 1024px; height : 500px;'>
</div>
</body>
</html>
建议?
非常感谢,
迈克尔
I am having trouble taking my tilemill project
to my webserver and using OpenLayers to draw
my map.
We are using tilemill to style the map > mbtiles
export > mbutil to directory > openlayers.tms
I have attached below the code we are using,
which is a modification of the OpenLayers.TMS
example.
Here is the link to my map and you will see the
problem, first hand:
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers Tiled Map Service Example</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 0;
var lat = 0;
var zoom = 0;
var map, layer;
function init(){
OpenLayers.ImgPath = "http://js.mapbox.com/theme/dark/";
map = new OpenLayers.Map( 'map', {maxResolution:1.40625/2} );
layer = new OpenLayers.Layer.TMS( "ttc",
"http://wrimaptube.nfshost.com/ttctiles3/", {layername: 'ttc3', type:'png'} );
map.addLayer(layer);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
function addTMS() {
l = new OpenLayers.Layer.TMS(
OpenLayers.Util.getElement('layer').value,
OpenLayers.Util.getElement('url').value,
{
'layername': OpenLayers.Util.getElement('layer').value,
'type': OpenLayers.Util.getElement('type').value
});
map.addLayer(l);
map.setBaseLayer(l);
}
</script>
</head>
<body onload="init()">
<div id="map" style='width: 1024px; height : 500px;'>
</div>
</body>
</html>
Suggestions?
Thanks a lot,
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用以下位置找到的代码修复了它:
http://wiki.openstreetmap.org/wiki/Talk:Openlayers_POI_layer_example
以下是代码看起来像我的 MAP:
但是,我仍然遇到问题与 OpenLayers.Controls 类...我将把它留到另一天。 (如您所见,未创建 panzoombar、layerswitcher、固定链接和鼠标位置......)
Fixed it using the code found on:
http://wiki.openstreetmap.org/wiki/Talk:Openlayers_POI_layer_example
Here is what the code looks like for my MAP:
However, I am still having trouble with the OpenLayers.Controls class... I'll leave that for another day. (as you can see, the panzoombar, layerswitcher, permalink and mouseposition are not being created..)