Commit Graph

34 Commits

Author SHA1 Message Date
John Firebaugh
b383bfec1f Fix unclosed area rendering (fixes #1958) 2013-11-13 17:41:57 -08:00
John Firebaugh
8323c948a7 jshint fixes 2013-10-24 15:33:52 -07:00
John Firebaugh
f9eaed7fb9 Add clipping back 2013-10-21 16:04:59 -07:00
John Firebaugh
4cce2e8d3a Use streams better 2013-10-21 16:04:59 -07:00
tyr
e8d637f2bb Add iD.geo.sphericalDistance
iD.geo.euclideanDistance should only be used for calculations of 
projected coordinates or display (pixel) coordinates.

iD.geo.sphericalDistance calculates approximate geographical 
distances, accounting for distortions at higher latitudes. This 
can be used for determining the nearest node (operations.Delete,
actions.Circularize) or relative length comparisons (actions.Split).
2013-09-29 07:45:04 -07:00
John Firebaugh
34bf86a904 Fix oneway clipping (fixes #1595) 2013-06-13 16:54:53 -07:00
John Firebaugh
b55e7bb111 Fix one way marker rendering (fixes #1534) 2013-05-29 12:02:47 -07:00
John Firebaugh
c14e2e600e Fix strokes sometimes being clipped as polygons
Fixes #1527.
2013-05-28 20:30:41 -07:00
John Firebaugh
9495f8f1c0 Optimize area rendering
Use iD.svg.Path for caching, and teach iD.svg.Path to
round coordinates.
2013-05-13 17:48:18 -07:00
John Firebaugh
1823f2619f Clean up and simplify iD.svg.Lines 2013-05-13 09:37:00 -07:00
Ansis Brammanis
5ded5fca4e added support for oneway=1 and oneway=-1
fixes #1400
2013-05-01 11:10:02 -04:00
John Firebaugh
6941d1914b Perfect oneway markers 2013-04-26 17:33:01 -07:00
Ansis Brammanis
4eccd7015f corner destroying resampling for oneway markers 2013-04-25 18:41:49 -04:00
John Firebaugh
23a4c4792f Clean up iD.svg.LineString
Outer call to projection.stream isn't needed.
2013-03-13 17:31:25 -07:00
Tom MacWright
3e69ef6f9e Fix tests and global leak 2013-03-07 17:53:36 -05:00
Tom MacWright
0fafa340fe Start using d3 3.1.0
Update d3, use streams, d3.set, clip
Use clipping, fix side effects
2013-03-07 17:45:16 -05:00
Tom MacWright
d683d98945 Avoid unnecessary bind 2013-03-07 15:31:26 -05:00
Tom MacWright
a58df86126 Corner-preserving resampling 2013-03-07 15:31:26 -05:00
Tom MacWright
4c1f292378 Resample oneway paths to produce markers.
This uses a technique created by @mbostock in http://bl.ocks.org/mbostock/4965670
Need to confirm that this is faster. It is definitely cleaner.
2013-03-07 15:31:25 -05:00
Tom MacWright
71a4c5a383 Fix jshint errors - plz do not use unnecessary magic 2013-03-04 12:08:54 -05:00
John Firebaugh
60a290282c Clip lines with Cohen-Sutherland algorithm
This yields a 10x paint performance increase at
#map=18.88/38.85208/-76.72632, as measured with
Chrome Canary's "Continuous Page Repainting" mode.

Fixes #885.
2013-03-03 18:25:42 -08:00
Tom MacWright
61d7ec45b5 Banish function ( style 2013-02-12 16:35:47 -05:00
Tom MacWright
38b327fefe jshint fixes, fix global leak 2013-02-11 10:42:49 -05:00
Tom MacWright
7b33472203 Nix the array joins 2013-02-08 11:31:33 -05:00
Tom MacWright
a773aaaab4 Improve perf with some benchmarking.
Re translate change see http://jsperf.com/coerce-vs-join-array
2013-02-07 22:55:44 -05:00
John Firebaugh
5eb0644242 Improve multipolygon rendering
Multipolygon relations report their geometry as 'area' and are rendered
as such. However, they do not render a stroke. The stroke rendering
will come from the individual lines, which are given the tag
classes of their parent relations, allowing them to have a stroke
style matching the style of simple areas with the same tags.

Untagged circular ways are no longer considered areas. This prevents
an untagged inner way of a multipolygon from rendering as an area and
is consistent with how P2 and JOSM treat them.

In the CSS, it's no longer necessary to deal with multipolygons
explicitly in selectors. But keep in mind that area boundaries can
now be rendered either as lines or as area strokes. In most cases
the selector should be `path.stroke.tag-_____`, i.e. an explicit
`.area` or `.line` classes should not be included.

Finally, the parent ways of selected multipolygons are given the 'selected'
class.
2013-02-05 15:20:11 -08:00
Tom MacWright
e5ad28feb7 JShint fixups 2013-02-04 12:10:23 -05:00
John Firebaugh
5ea855e18d Replace Graph#fetch with Graph#childNodes
Having two kinds of Ways (fetched and non-fetched)
introduced some accidental complexity. This brings things
more in line with how parentWays/parentRelations work.

Fixes #73.
2013-01-25 15:10:44 -05:00
John Firebaugh
c263ebd4dc iD.util.geo => iD.geo 2013-01-22 18:20:20 -05:00
John Firebaugh
f64c2df17f Return null rather than empty string
Empty string still generates the error 'Problem parsing d=""',
while null results in no 'd' attribute at all.
2013-01-17 11:57:29 -08:00
John Firebaugh
e24b22b518 Extract iD.svg.LineString 2013-01-17 11:57:29 -08:00
John Firebaugh
9f1506af5e Always use rounded projection 2013-01-17 11:57:29 -08:00
Tom MacWright
87c341d7e0 Fix jshint problems. 2013-01-16 12:39:35 -05:00
John Firebaugh
6aa43f44d0 Split map rendering into some components 2013-01-11 07:04:40 -08:00