Skip to content

Commit

Permalink
Mapbox (Mapzen) vector tiles improvements #57
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Dec 29, 2016
1 parent f1f5726 commit 80848f9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.md
Expand Up @@ -6,7 +6,7 @@
- Improved gestures implementation [#253](https://github.com/mapsforge/vtm/issues/253)
- Polygon label position enhancements [#80](https://github.com/mapsforge/vtm/issues/80)
- vtm-web modules update [#51](https://github.com/mapsforge/vtm/issues/51)
- Mapbox vector tiles [#57](https://github.com/mapsforge/vtm/issues/57)
- Mapbox (Mapzen) vector tiles [#57](https://github.com/mapsforge/vtm/issues/57)
- SVG resources scaling in themes [#214](https://github.com/mapsforge/vtm/issues/214)
- Circle map style [#122](https://github.com/mapsforge/vtm/issues/122)
- Oneway arrows in themes [#275](https://github.com/mapsforge/vtm/issues/275)
Expand Down
Expand Up @@ -30,7 +30,7 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

UrlTileSource tileSource = MapboxTileSource.builder()
.apiKey("vector-tiles-xxxxxxx") // Put a proper API key
.apiKey("mapzen-xxxxxxx") // Put a proper API key
.build();

VectorTileLayer l = mMap.setBaseMap(tileSource);
Expand Down
54 changes: 29 additions & 25 deletions vtm-themes/resources/assets/vtm/mapzen.xml
Expand Up @@ -172,7 +172,7 @@
<!-- tourism areas
Berlin Zoologischer Garten has lots of details that should be drawn above
-->
<!-- <m k="tourism" v="attraction"> <area fill="#f2caea" /> </m> -->
<!-- <m v="attraction"> <area fill="#f2caea" /> </m> -->

<m v="zoo|picnic_site|caravan_site|camp_site">
<area fill="#c0d69a" />
Expand Down Expand Up @@ -315,26 +315,26 @@
e="way" k="area" v="~|no|false"> <line stroke="#b7c690" width="0.75"
/> </m> </m> -->
</m>
</m>

<!-- area outlines need to be above to avoid uggly pixelation where
not aliased polygon overlaps the lines... -->
<m zoom-min="14">
<!-- area outlines need to be above to avoid uggly pixelation where
not aliased polygon overlaps the lines... -->
<m zoom-min="14">

<m v="nature_reserve">
<line cap="butt" fix="true" stroke="#abe29c" width="1.0" />
<m v="nature_reserve">
<line cap="butt" fix="true" stroke="#abe29c" width="1.0" />
</m>
<m v="military">
<line use="fence" />
</m>
</m>
<m v="military">
<line use="fence" />
<m v="reservoir|basin">
<area use="water" />
</m>
</m>
<m v="reservoir|basin">
<area use="water" />
</m>

<!-- ...should rewrite tag to: highway=leisure/sport=* imho -->
<m v="track">
<line cap="butt" fix="true" stroke="#c1bcb6" width="1.3" />
<!-- ...should rewrite tag to: highway=leisure/sport=* imho -->
<m v="track">
<line cap="butt" fix="true" stroke="#c1bcb6" width="1.3" />
</m>
</m>
</m>

Expand Down Expand Up @@ -382,12 +382,11 @@
<line fade="9" use="water" width="0.1" />
</m>
</m>
<!-- TODO this breaks the rendering
<m v="riverbank|dock">
<!-- TODO this breaks the rendering -->
<!--<m v="riverbank|dock">
<area use="water" />
<line use="water:outline" />
</m>
-->
</m>-->
<m v="weir">
<line stroke="#000088" use="fix" />
</m>
Expand Down Expand Up @@ -500,10 +499,10 @@
</m>
<!-- railway tunnel -->
<m k="railway">
<!-- <m k="railway" v="tram|subway|light_rail|narrow_gauge">
<!-- <m v="tram|subway|light_rail|narrow_gauge">
<line stroke="#a0a0a0" width="0.8" cap="butt" fix="true"/>
</m> -->
<m k="railway" v="rail">
<m v="rail">
<line cap="butt" fix="true" stroke="#aa888888" width="0.9" />
</m>
</m>
Expand Down Expand Up @@ -891,11 +890,11 @@
stipple-width="0.8" stroke="#aaa6a4" width="2.0" />
</m>

<!-- <m k="railway" v="rail" zoom-max="14" zoom-min="13">
<!-- <m v="rail" zoom-max="14" zoom-min="13">
<line stroke="#8888aa" width="0.6" cap="butt"
fix="true" />
</m> -->
<!-- <m k="railway" v="rail" zoom-max="13" zoom-min="11">
<!-- <m v="rail" zoom-max="13" zoom-min="11">
<line stroke="#bbbbcc" width="0.8" cap="butt" fix="true" />
</m> -->
<!-- whatever railway:spur means ... -->
Expand Down Expand Up @@ -1136,7 +1135,7 @@
<m v="bank">
<symbol src="assets:symbols/money/bank2.svg" />
</m>
<!--<m k="amenity" v="bench">
<!--<m v="bench">
<symbol src="assets:symbols/bench.svg" />
</m>-->
<m v="bicycle_rental">
Expand Down Expand Up @@ -1231,6 +1230,11 @@
<symbol src="assets:symbols/shopping/supermarket.svg" />
</m>

<!-- TODO show rest shops -->
<!--<m zoom-min="17">
<symbol src="assets:symbols/dot_magenta.svg" />
</m>-->

<m select="when-matched" zoom-min="17">
<text use="poi" />
</m>
Expand Down
4 changes: 1 addition & 3 deletions vtm/src/org/oscim/layers/tile/buildings/BuildingLayer.java
@@ -1,6 +1,7 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016 Robin Boldt
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
Expand Down Expand Up @@ -33,11 +34,8 @@
import org.oscim.theme.styles.ExtrusionStyle;
import org.oscim.theme.styles.RenderStyle;
import org.oscim.utils.pool.Inlist;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BuildingLayer extends Layer implements TileLoaderThemeHook {
static final Logger log = LoggerFactory.getLogger(BuildingLayer.class);

private final static int MIN_ZOOM = 17;
private final static int MAX_ZOOM = 17;
Expand Down

0 comments on commit 80848f9

Please sign in to comment.