Commit Graph

20 Commits

Author SHA1 Message Date
John Firebaugh b62f106be8 Extract Relation#replaceMember 2013-02-06 13:42:34 -08: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
John Firebaugh 8735413974 Relation#asGeoJSON 2013-02-05 15:20:11 -08:00
John Firebaugh 72cd6b91fa Relation#multipolygon returns coordinate arrays 2013-02-05 15:20:11 -08:00
John Firebaugh 08bd7e583a Define Relation#asJXON (allow relations to be saved) 2013-01-28 10:19:11 -05:00
Tom MacWright 4e2124e74f jshint 2013-01-25 18:48:07 -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 292c916cb1 Converting some actions to entity methods
The guidelines here are:

Entity methods:
  return a modified entity
  don't necessarily maintain whole-graph consistency

Actions:
  return a modified graph
  always maintain whole-graph consistency
  call entity methods liberally
  generally don't call other actions
2013-01-23 12:40:27 -05:00
John Firebaugh c263ebd4dc iD.util.geo => iD.geo 2013-01-22 18:20:20 -05:00
John Firebaugh 381794e7a1 Fix Relation#multipolygon for unmatched inner rings (fixes #461) 2013-01-22 17:54:57 -05:00
John Firebaugh d74bf1e39a Use proper prototypal inheritance and less dynamic new 2013-01-22 17:38:52 -05:00
John Firebaugh b27903f7b5 Add Relation#isRestriction 2013-01-18 14:44:28 -08:00
John Firebaugh 3349e1f69c Add some utility methods to Relation 2013-01-18 14:44:28 -08:00
John Firebaugh bf251dce15 Handle incomplete relations 2013-01-17 17:37:50 -08:00
John Firebaugh 9abe3af312 Fix extent and difference rendering for multi polygons 2013-01-17 14:27:01 -08:00
John Firebaugh 1d707b0eb2 Match inners with outers
After thinking about how the `evenodd` fill rule works, I pretty sure
we don't actually need to do this. If I'm right, I'll back it out, and
it will be in the history if we need it for some other purpose.
2013-01-13 18:17:16 -08:00
John Firebaugh 67c8e287cf Start on multipolygon reconstruction algorithm 2013-01-13 17:20:04 -08:00
John Firebaugh 15099ee517 Define Relation#geometry 2013-01-07 12:15:16 -08:00
John Firebaugh d181df4c51 Polymorphism 2012-12-28 22:24:52 -08:00
John Firebaugh f7dfda46b2 Move Entity subclasses to separate files 2012-12-28 22:17:09 -08:00