40 Commits

Author SHA1 Message Date
Kyℓe Hensel
1c5b3b4051 use a more visible colour for oneway arrows on dark lines (#9143) 2025-01-15 11:38:36 +01:00
Kyℓe Hensel
fb8b969c3f fix non-integer layer tag causing invisible features (#9933) 2025-01-15 11:35:18 +01:00
Martin Raifer
97442403cf drop validator which checks for old style multipolygons
these have long been [fixed](https://blog.jochentopf.com/2017-08-28-polygon-fixing-effort-concluded.html) in OSM

see wiki: https://wiki.openstreetmap.org/wiki/Old_style_multipolygons
2024-02-29 13:28:22 +01:00
Bryan Housel
33fab5580b Before calling init() make sure the assetPath is set
init kicks off building the ui, which can fetch spritesheets for the <defs>
The assetPath needs to be set otherwise these files will not be found
2021-08-16 22:06:42 -04:00
Quincy Morgan
e391edcc5c Namespace various internal SVG ids under ideditor (re: #7445) 2020-03-22 14:39:40 -07:00
Quincy Morgan
c893147e15 Convert some element ids to classes to avoid collisions when embedding iD 2020-03-20 13:53:17 -07:00
Bryan Housel
e19bcb77d5 Require init() call before coreContext starts doing things
(closes #7304)
2020-01-29 19:27:12 -05:00
Quincy Morgan
8818bf1b1c Fix code tests to represent moved multipolygon line classes behavior 2019-12-11 18:05:26 -05:00
Huon Wilson
dd0be84da4 Add one-sided triangular markers to ways with sides (e.g. natural=cliff).
This generalizes the oneway arrow logic for adding SVG markers along a
line. Using that functionality, certain tags get arrows on their
right-hand side, indicating which side is "inside", e.g. the
right-side of a cliff is the lower side.

The list of tags considered to be sided (unless there's a
two_sided=yes tag) is:

- natural=cliff
- natural=coastline
- barrier=retaining_wall
- barrier=kerb
- barrier=guard_rail
- barrier=city_wall
- man_made=embankment

The triangles attempt to be reminiscent of the triangles used for
rendering cliffs on OSM (and elsewhere). The different tags get
different renderings (e.g. colors that match the main way, and
different spacings). In addition, natural=coastline is special-cased
to have blue markers (despite having a green way), to emphasise that
the "inside" of a coastline is the water.

Fixes https://github.com/openstreetmap/iD/issues/1475.
2018-11-28 01:45:50 +11:00
Huon Wilson
f356c6ac49 test: add tests for adding oneway arrows to lines 2018-11-28 01:25:04 +11:00
Bryan Housel
de488e252f Draw covered/underground lines beneath areas
(closes #4718)
2018-01-22 15:06:58 -05:00
Bryan Housel
2e2b037e36 Move a bunch of commonly used vector and projection math functions into geo
- geoVecAdd
- geoVecSubtract
- geoVecScale
- geoZoomToScale
- geoScaleToZoom
2017-12-18 15:05:42 -05:00
Bryan Housel
b9e48d1682 WIP: Move layer-hit to layer-points with explict sublayers, update tests
This is more work to further isolate the layers that entities draw to.
It makes it easier to debug what is going on, and can eventually lead to
deferred drawing, if each draw function is in its own place and not dependant
on anything else.

I've started to replace the vertex-hover with an explicit layer for touch
targets.

Also had to change a lot of the svg tests, which are really brittle.
Things would happen like - the surface would be created, it would kick of a
deferred redraw, which would notice that the zoom was 0 and call
editOff, which would remove the osm layers that were just created and
that the tests were trying to draw to. These tests need proper zoom and
projection otherwise nothing works.
2017-12-14 17:38:43 -05:00
Bryan Housel
89013627fb Don't consider untagged multipolygons as old multipolygons
Also add a lot of old-style multipolygon tests
(closes #4009)
2017-05-04 12:16:04 -04:00
Bryan Housel
d07d20cba7 Drop custom "classed" chai assertation and just use d3 2017-04-24 10:27:29 -04:00
Bryan Housel
4903d495b7 Draw selected items last, so halos are more visible
(see #2914)
2017-03-21 02:17:04 -04:00
Bryan Housel
f800e5afbc Remove unnecessary window parameter to Context 2016-11-10 15:19:03 -05:00
Bryan Housel
87950fd472 Fix lib export, flatten names in tests and docs 2016-10-04 21:56:09 -04:00
Bryan Housel
273407da3d Fix svg layer selections, fix and add tests.. 2016-09-09 14:19:13 -04:00
Tom MacWright
20962074ba Fix vertices areas midlines 2016-09-06 10:58:07 -04:00
Bryan Housel
a86f34b4ef Pacify eslint, get build and tests running again 2016-08-26 01:15:07 -04:00
Tom MacWright
cdb533fa84 Begin d3 v4 update 2016-08-21 15:19:27 -04:00
Bryan Housel
7ca6d06254 Replace iD global with iD.Context() module (#3254) 2016-07-19 10:15:32 -04:00
Kushan Joshi
1db442b9e8 Remove linting errors fromspec/svg 2016-06-15 18:26:11 +05:30
Bryan Housel
e22bd1eceb Pass projection to iD.svg.Layers in tests 2016-06-10 13:06:28 -04:00
Bryan Housel
45e4e730a8 iD.svg.Surface -> iD.svg.Layers 2016-02-24 15:41:22 -05:00
John Firebaugh
a3c7b5956d Remove obsolete tests 2014-06-13 12:03:08 -07:00
Bryan Housel
38cb42e0bc Add tests for line z-indexing. 2014-06-11 22:30:36 -04:00
Bryan Housel
7f35ab6125 separate svg group for areas and their related strokes/fills
(for consistency)
2014-06-11 13:01:27 -04:00
John Firebaugh
cdd9f8ba5f Fix SVG parse errors in specs (fixes #2012) 2013-11-22 11:16:08 -08:00
John Firebaugh
d6c7c1d81d Fix tests 2013-10-21 16:24:06 -07:00
John Firebaugh
fd1573fa08 Abandon iD.svg.MemberClasses
Substantial performance hit for something that's barely used.
2013-05-13 12:46:01 -07:00
John Firebaugh
6941d1914b Perfect oneway markers 2013-04-26 17:33:01 -07:00
John Firebaugh
77ce20c8c1 Add configurable image path 2013-04-16 17:20:21 -07:00
Tom MacWright
3e69ef6f9e Fix tests and global leak 2013-03-07 17:53:36 -05:00
Tom MacWright
1228155551 Fix tests
Way lines are no longer the only paths on the map, so we need to be more
specific.
2013-03-07 15:31:26 -05:00
John Firebaugh
98d1ee4f10 Fix rendering of multipolygons with the tags on the outer way
From the wiki:

> If you have one closed way making up the outer ring and it does not
> describe something in its own right, you may also put these tags on
> the outer ring and leave the relation untagged.

During line and area rendering, fix up such ways so that they are
rendered as if the tags were on the relation instead.

Fixes #613.
2013-03-06 13:22:43 -08:00
John Firebaugh
8aaa91d96f Fix tests 2013-03-04 08:00:12 -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
2c6e244fb0 Add tests for iD.svg.Lines 2013-01-17 15:17:40 -08:00