Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style-property-aware hit testing #316

Closed
ansis opened this issue Feb 27, 2014 · 9 comments · Fixed by #2052
Closed

style-property-aware hit testing #316

ansis opened this issue Feb 27, 2014 · 9 comments · Fixed by #2052

Comments

@ansis
Copy link
Contributor

ansis commented Feb 27, 2014

map.featuresAt current takes a constant radius as one of the parameters. For interaction, it would be useful to be able to have this radius depend on the map style.

For example, if road_regular width is 10 the radius would be 5.

@mourner
Copy link
Member

mourner commented Feb 27, 2014

How would we define the property to depend on API-wise?

@ansis
Copy link
Contributor Author

ansis commented Feb 27, 2014

How would we define the property to depend on API-wise?

not sure. Maybe have it be the default unless a radius is specified?

@mourner
Copy link
Member

mourner commented Feb 27, 2014

I mean, how would llmr know that we need to check e.g. road_regular?

@ansis
Copy link
Contributor Author

ansis commented Feb 27, 2014

We would process the style so that we have a radius for each bucket and send those over to the worker. When doing the rtree query it would just use the max radius. Each feature from the tree should have a ._bucket property that could be used to choose the right radius when narrowing down the features.

@edenh
Copy link
Contributor

edenh commented Feb 27, 2014

I think there are still times when you want to designate a bigger 'hit area' for a feature. If you have a 2px radius dot, for example, you could set the radius higher to be more clickable.

Maybe we could set the default for each bucket to be true to the current map style, but allow for radius override?

@incanus
Copy link
Contributor

incanus commented Feb 27, 2014

For interaction

Do you mean in terms of map interactivity design? Or something else?

@ansis
Copy link
Contributor Author

ansis commented Feb 27, 2014

Do you mean in terms of map interactivity design? Or something else?

Map interactivity. Right now map.featuresAt returns features who's geometries are within a radius of a point. This would be to make it easy to return features that are rendered at a specific point so that its easy to add interaction that matches the rendering.

@edenh
Copy link
Contributor

edenh commented Apr 16, 2014

This may be unrelated, but another interesting option here is to support voronoi-style interaction to get the closest point. D3 example: http://bl.ocks.org/mbostock/7608400

@incanus
Copy link
Contributor

incanus commented Apr 21, 2014

Neat @edenh. That's particularly interesting for touch/native given the ~44px wiggle room a "point" typically has there.

@mourner mourner added this to the future milestone Jun 24, 2014
@jfirebaugh jfirebaugh changed the title map.featuresAt radius based on style style-property-aware hit testing Feb 19, 2015
@jfirebaugh jfirebaugh removed this from the future milestone Jun 15, 2015
ansis added a commit that referenced this issue Feb 5, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 9, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 9, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 9, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 13, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 13, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Feb 23, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Mar 9, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Mar 16, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Mar 17, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Mar 21, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
ansis added a commit that referenced this issue Mar 24, 2016
map.featuresAt now includes features whose rendered representation
matches the query, not features whose geometry matches the query.

A query with `radius: 0` will now match lines and circles if the point
is within the rendered line.

also fix #2053
It now checks intersection based on the render type not the geometry
type. A polygon that is rendered as a line will only match if the query
matches the line. It will not include it if the query only matches in
the internal part of the polygon.

implemented:
circle-radius
circle-translate
fill-translate
line-width
line-offset
line-translate

not implemented yet (hard with the current symbol index):
text-translate
icon-translate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants