在mapsforge中有很多“缩放”的方法。
如本示例所示,您可以尝试直接缩放模型,而不是缩放模型。
如果这是您所要求的,请尝试以下操作:.zoom()
mapViewPosition
法典:
MapViewPosition mapViewPosition = mapView.getModel().mapViewPosition;
mapViewPosition.zoom((byte) XX); // Change it to a number (i.g. "(byte) 3")
我甚至看不懂街道名称。
但是,如果您正在谈论UI文本,则可以尝试像这样更改它:
mapView.setTextScale(XX); // Again, number goes here
如果只有文本大小对您来说还不够,您可以尝试创建一个新的渲染主题。
文档示例:
法典:
tileRendererLayer.setXmlRenderTheme(new ExternalRenderTheme(File)) // File should be
// the XML file for the RenderTheme
XML:
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns="http://mapsforge.org/renderTheme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mapsforge.org/renderTheme renderTheme.xsd" version="1">
<!-- matches all ways with a "highway=trunk" or a "highway=motorway" tag -->
<rule e="way" k="highway" v="trunk|motorway">
<line stroke="#FF9900" stroke-width="2.5" />
</rule>
<!-- matches all closed ways (first node equals last node) with an "amenity=…" tag -->
<rule e="way" k="amenity" v="*" closed="yes">
<area fill="#DDEECC" stroke="#006699" stroke-width="0.3" />
</rule>
<!-- matches all nodes with a "tourism=hotel" tag on zoom level 16 and above
-->
<rule e="node" k="tourism" v="hotel" zoom-min="16">
<symbol src="file:/path/to/symbol/icon/hotel.png" />
<caption k="name" font-style="bold" font-size="10" fill="#4040ff" />
</rule>
</rendertheme>