本文介绍了地图不会显示建筑物号码(tileMill + OSM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用tileMill为我的iPhone应用程序创建脱机地图,长篇小说 - 我已从)我找不到包含房屋号码的图层。



设置房屋号码标签的代码:

  #housenumbers { 
[zoom> = 17] {
text-name:[addr:housenumber];
文本放置:内部;
text-min-distance:1;
text-wrap-width:0;
text-face-name:@ book-fonts;
文字填写:#444;
text-size:9;
}
}

#housenames {
[zoom> = 17] {
text-name:[addr:housename];
文本放置:内部;
text-wrap-width:20;
text-face-name:@ book-fonts;
text-size:8;
文字填写:#444;
[zoom> = 18] {
text-size:9;
}
}
}


解决方案

您需要了解,OSM.org使用一个名为的纯渲染引擎。 是通过简化样式表来围绕Mapnik的包装。



如@scai所言,您需要创建一个样式表,为样式表提供标签。我不熟悉瓷砖,告诉你需要做什么,但通常这包括




  • 添加标签符号addr:housenumber = *标签,并以适当的字体和大小打印值

  • (创建处理建筑物轮廓等内标签位置的假节点)


i'm using tileMill for creating offline map for my iPhone app, long story short - i've downloaded OSM data for Ukraine region from here. I've checked that online map(from link) is showing building numbers as you can see in picture:

but after importing data, that i've download, to tile mill there's no building numbers:

any idea why this is happening? Thanks!

EDIT: I figure out how to set up house numbers label, but when i'm importing data to tilemill (with this tutorial) i can't find layer that contains house numbers.

Code for setting label for house numbers:

#housenumbers {
  [zoom >= 17] {
    text-name: "[addr:housenumber]";
    text-placement: interior;
    text-min-distance: 1;
    text-wrap-width: 0;
    text-face-name: @book-fonts;
    text-fill: #444;
    text-size: 9;
  }
}

#housenames {
  [zoom >= 17] {
    text-name: "[addr:housename]";
    text-placement: interior;
    text-wrap-width: 20;
    text-face-name: @book-fonts;
    text-size: 8;
    text-fill: #444;
    [zoom >= 18] {
      text-size: 9;
    }
  }
}
解决方案

You need to understand, that OSM.org uses a pure rendering engine called Mapnik. Tilemill is a wrapper around Mapnik by simplifying stylesheets.

As @scai say, you need to create a stylesheet that renders a label for housenumbers. I'm not familar with tilemill to tell you what need to be done, but usually this consist of

  • Adding a label symbolizer that looksup the addr:housenumber=* tag and prints the value in a appropriate font and size
  • (creating fake nodes that deal with the placement of that labels within building outlines etc.)

这篇关于地图不会显示建筑物号码(tileMill + OSM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 18:55