v0.11.0
Enhancements
- 10% reduction in minified + gzipped bundle size
- 25% faster label collision, as measured on a complex label scene (Bubble Wrap central London at z17) #440
- New placement strategies for improved cartographic symbols including road shields and one-way street arrows #409 #441
placement
parameter to specify howpoints
-based styles should be applied to line or polygon features:placement: vertex
: place points at line/polygon ring vertices (default and previous library behavior)placement: midpoint
: places points at line/polygon ring segment midpoints (better for road shields, to avoid ambiguous intersections such as highway interchanges)placement: spaced
: places points along a line/polygon ring at fixed intervals, useful for symbols like one-way street arrows where consistent spacing is desirable- Spacing defined in pixels with
placement_spacing
parameter; defaults to80px
, also accepts zoom stops or JS functions
- Spacing defined in pixels with
placement: centroid
: places points at polygon outer ring centroid- Only applicable for polygons (supersedes previous
centroid: true
parameter)
- Only applicable for polygons (supersedes previous
- Additional parameters for
placement
values ofmidpoint
andspaced
:placement_min_length_ratio
parameter specifies the minimum line segment length as a ratio to the point being placed- Can be used to tune the number of symbols such as road shields up (with lower values) or down (with higher values), and avoid undesirable cases where a point obscures the underlying line segment
placement_min_length_ratio
defaults to1
, requiring line segment to be at least as long as the point itself- See #441 for more examples
tile_edges
parameter indicates whether points should be placed along tile boundaries (usually undesirable)- Applies same logic as
lines
styles. tile_edges
defaults tofalse
.
- Applies same logic as
- Enable repeat behavior (
repeat_distance
andrepeat_group
parameters) forpoints
-based styles- Separate
repeat_distance
values can apply to apoints
-based draw group with an attachedtext
. The former, on the "parent" point, determines how often any object of that type may repeat, while the latter, on the "child"text
, determines how often an object with that specific text may repeat.- Example: one may wish for road shields generally to appear within
80px
of one another, while requiring that a specific shield for the same highway only repeat every200px
- Example: one may wish for road shields generally to appear within
- Separate
shields:
repeat_distance: 80px # any given shield can appear within 80px of any other shield
...
text:
repeat_distance: 200px # shields with the same text must appear at least 200px apart
- Allow scene
import
values to be JS objects 654b29a- Allows for scene properties to be overridden at initial load time, without need to hook into Tangram events or update scene after load
- Example of this pattern, setting English language preference and enabling transit overlay on Mapzen's Bubble Wrap style at load time:
scene.load({
import: [
'https://mapzen.com/carto/bubble-wrap-style/5/bubble-wrap.yaml',
{ global: { ux_language: 'en', sdk_transit_overlay: true } }
]
});
- Adds smoothly animated double-click zoom via Leaflet plugin 655ad75
- Similar to default behavior of other popular vector map products
- Can be disabled with
modifyDoubleClickZoom: false
on initialization ofTangram.leafletLayer
- Data source
transform
functions will now be invoked for non-tiled and MVT data sources #434- Previously, these functions were only applicable to tiled
GeoJSON
orTopoJSON
sources
- Previously, these functions were only applicable to tiled
- Second argument of
Scene.load()
has been transitioned to a fulloptions
object (with backwards compatible support for specifyingconfig_path
string as the argument value) d392bb1
Bug Fixes
- On initial map load, do not block map rendering on loading/building of all tiles, e.g. tiles should "pop in" incrementally as they are finished building 92e4455
- Fix bounding boxes for labels with Italic fonts #431
Internal
- Remove use of ES6 features that
- Are not transpiled efficiently (including
for..of
loops, generators) - Can reduce bundle size by avoiding polyfills (
Set
,Map
)
- Are not transpiled efficiently (including
- Upgrade to TopoJSON 2.x, and use slimmed down fork to only include methods used by Tangram.