Commit Graph

1716 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
a1c701ca93 Remove unused variable 2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
d207166abe Remove unused function: cwd() 2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
8a9665b085 Deffer updateAnnotationTiles() if Source is not available
The Style object might have been created but the Source is not
yet available because the JSON file was not set. Can happen
specially when the style is loaded from the network.
2015-07-10 20:25:49 +03:00
Nicki Dlugash
d63f706c5f Merge pull request #1840 from mapbox/repeat-distance
Updates to labels along lines
2015-07-10 10:59:37 -04:00
Thiago Marcos P. Santos
b33d5d8a95 Do not report isLoaded() if loading failed 2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
0ee9f21c56 Report Sprite parsing errors to Observers
Parsing errors will be reported to Observers. In practice this will
bubble all the way to the Map object.

This will make possible to identify possible corrupted data instead
of rendering without sprites like we do in case of semantic errors.
2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
f64ba78910 Merge Sprite loading notifications
Because they are pretty much the same thing.
2015-07-10 10:48:46 +03:00
Nicki Dlugash
f27bd6b68f Updates to labels along lines
Added a filter to remove anchors with the same text that are too close to each other.

Updates to spacing and offset of anchor placement along lines:

Takes into account icon size for calculating label length.

Recalculates spacing for long labels.

Adjusts offsets to first anchors if line is continued from outside the tile boundary.
2015-07-09 18:52:12 -04:00
Justin R. Miller
cd7c3ddb9c fixes #1858: proper shape placement in style layers 2015-07-09 08:55:12 -07:00
Konstantin Käfer
c66ec8739b show info message when Sprite does not exist 2015-07-08 19:46:03 +02:00
Konstantin Käfer
d37bd549bc make sure that the SpriteStore object correctly replaces the SpriteImages 2015-07-08 19:46:02 +02:00
Konstantin Käfer
32699333e6 add image to odd pixelRatio atlas 2015-07-08 19:46:02 +02:00
Konstantin Käfer
d08ec53a0e add test for fractional pixel ratios 2015-07-08 19:46:02 +02:00
Konstantin Käfer
a57f3ddceb add basic SpriteAtlas test 2015-07-08 19:46:02 +02:00
Konstantin Käfer
c5ed00ae7a fix sprite debug window code 2015-07-08 19:46:02 +02:00
Konstantin Käfer
746e4d20ee explicitly name the sprite that couldn't be changed 2015-07-08 19:46:02 +02:00
Konstantin Käfer
62ac43a85b add ability to add random custom markers to test app 2015-07-08 19:46:02 +02:00
Konstantin Käfer
b2a3314192 replace Style object immediately
this makes sure that adding custom sprite imagery will add them to the new Style object rather than
the old one in case a user adds new custom sprites immediately after changing a stylesheet
2015-07-08 19:46:01 +02:00
Konstantin Käfer
f9601ae685 add ability to set custom sprites on the Map object 2015-07-08 19:46:01 +02:00
Konstantin Käfer
70d0a26f98 key sprites in sprite atlas by name and wrap value 2015-07-08 19:46:01 +02:00
Konstantin Käfer
a0e391c0cb make sure that Sprite isn't marked as loaded until we actually added everything to the SpriteStore 2015-07-08 19:46:01 +02:00
Konstantin Käfer
6271f8e546 mark Image constructor as explicit to avoid accidental implicit argument conversion
when passing a std::string instead of an Image, the parameter gets implicitly and automatically converted (== parsed) to a temporary Image object. Since parsing an Image shouldn't be a frequent operation
2015-07-08 19:46:01 +02:00
Konstantin Käfer
bc41d3cf6d don't restrict pixelRatio in SpriteStore
this is required so that devices that aren't using 1x or 2x (like the iPhone 6 Plus with a pixelRatio of 3x) still show icons, albeit bilinearly scaled to the correct size in the SpriteAtlas
2015-07-08 19:46:01 +02:00
Konstantin Käfer
afaf74e41a use SpriteStore from the SpriteAtlas 2015-07-08 19:46:00 +02:00
Konstantin Käfer
d2ee014c6e move SpriteAtlas to the SpriteStore backend 2015-07-08 19:46:00 +02:00
Konstantin Käfer
aa2dcf1968 disallow changing an existing Sprite's size 2015-07-08 19:46:00 +02:00
Konstantin Käfer
d880507f84 add missing headers 2015-07-08 19:46:00 +02:00
Konstantin Käfer
33a3388ccd add API for adding multiple sprites at once 2015-07-08 19:46:00 +02:00
Konstantin Käfer
54aaa43b6d add test for trying to add mismatched SpriteImage 2015-07-08 19:46:00 +02:00
Konstantin Käfer
a96a8fef76 add a separate SpriteParser object
transforms a JSON and an associated PNG file into individual SpriteImage objects that can be inserted into a SpriteStore
2015-07-08 19:45:59 +02:00
Konstantin Käfer
a68b47b969 ratio => pixelRatio 2015-07-08 19:45:59 +02:00
Konstantin Käfer
7f705da564 Sprite store API 2015-07-08 19:45:59 +02:00
Ansis Brammanis
03c4ed75a2 increase simplification for line annotations
to make them look better when drawn semi-transparently
2015-07-08 16:16:51 +02:00
Ansis Brammanis
888ae5ebdc improve round line joins for semi-transparent lines
https://github.com/mapbox/mapbox-gl-js/pull/1359

Round line joins used to be drawn by adding a semicircle cap to the end
of each segment. This looked fine for opaque lines not for
semi-transparent lines.

This changes the triangulation so that round line joins don't overlap
with segments. The gap between segments is filled with small triangles
that look like pie slices. The edge of the round linejoin is made up of
many short straight lines that look round at the sizes we draw lines.

Since sharp angles are infrequent, this does not significantly affect
the total number of triangles created.

Joins for angles that are really sharp are still drawn with overlap.
2015-07-08 16:16:51 +02:00
Konstantin Käfer
675ddddee7 Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
2015-07-08 10:40:05 +02:00
Minh Nguyễn
4c1f325bf6 Moved raster zoom threshold to the .5’s
Fixes #963.
2015-07-07 12:14:26 -07:00
Minh Nguyễn
08acb65b1c Eliminated map overrotation on drift pan
Wrap the angle on each interpolated step instead of when normalizing.
2015-07-06 13:08:59 -07:00
Minh Nguyễn
46a6173bd7 [wrap)
If (wrap] is desired, it is the responsibility of the caller to handle the case in which min is returned.
2015-07-06 13:07:34 -07:00
Thiago Marcos P. Santos
ec1b4c43fd Do not force uv_loop_t as the first parameter for a threaded object ctor 2015-07-06 16:01:59 +03:00
Thiago Marcos P. Santos
f6b8dd4be9 Add simple static method to retrieve the current loop
In the lines of how we do for getting information of the
current thread.
2015-07-06 15:54:51 +03:00
John Firebaugh
108792420c Check for matching source when parsing tiles (fixes #1698) 2015-07-02 15:56:02 -07:00
Thiago Marcos P. Santos
9cc986e758 Report errors when parsing raster tiles
Use the same API/pattern for parsing raster tiles as we use for vector
tiles. Forward the error as an exception that will ultimately reach the
StillImageCallback.

Also set the tile to State::obsolete on error like we do for vector
tiles.
2015-07-02 23:21:42 +03:00
John Firebaugh
c357ce540a Use unique_ptr for Source objects (fixes #904) 2015-07-02 12:55:53 -07:00
Minh Nguyễn
9361cbfd5f Fixed round-tripping between pixelForLatLng() / latLngForPixel()
Followup to cfa2eaf5c2 for #1406.
2015-07-02 10:48:01 -07:00
John Firebaugh
f5f19d0eb0 External synchronization for AnnotationManager 2015-07-02 10:12:04 -07:00
John Firebaugh
117322d349 Don't inherit for code reuse 2015-07-02 10:12:04 -07:00
John Firebaugh
1da2c3f840 Remove unnecessary virtual methods from TileData 2015-07-02 10:12:03 -07:00
Ansis Brammanis
9d714dcf83 fix line tessellation, fix #1814 2015-07-02 13:18:59 +02:00
Ansis Brammanis
a8f77d23cc reduce collision box linewidth to 1
06eece43a8
2015-07-02 12:35:15 +02:00
Ansis Brammanis
45e4938f9e fix cross-tile label collisions
fix #1816
fix #1689

The missing label was the only one in it's bucket. Since the label was
outside the tile boundaries it wouldn't need to be drawn by the bucket.
Since the bucket had no features to draw, it was dropped completely.
Even if a bucket doesn't have any features that need to be rendered, it
may have features that need to impact the placement of features in other
layers.
2015-07-02 12:31:50 +02:00