-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
featuresAt returns bucketType as designated in stylesheet, refs #876 #879
Conversation
|
The results should use terms that are consistent with the rest of the API and style-spec. So, How about:
|
Now returning {
"$type": "line",
"layer": {
"id": "waterway",
"type": "line",
"layout": {
"line-cap": "round",
"line-join": "round",
"line-miter-limit": 2,
"line-round-limit": 1
},
"source": {
"id": "mapbox.mapbox-streets-v6-dev",
"source-layer": "waterway"
},
"paint": {
"line-opacity": 0.9,
"line-color": [0, 0.48, 0.78, 0.9],
"line-width": 1.25
}
},
"properties": {
"class": "river",
"osm_id": 93380892,
"type": "river"
},
"extent": 4096,
"type": 2
} Some questions:
|
Nice. |
Ah good catch, grabbed the wrong type — thanks! With {geometry: true}: this is a bit hard to make sense of. I'm not sure what the use case for this format is…? {
"$type": "LineString",
"layer": {
"id": "road",
"type": "line",
"layout": {
"line-cap": "butt",
"line-join": "miter",
"line-miter-limit": 2,
"line-round-limit": 1
},
"source": {
"id": "mapbox.mapbox-streets-v6-dev",
"source-layer": "road"
},
"paint": {
"line-color": [
0.78,
0,
0,
0.78
],
"line-dasharray": [
3.5,
2
],
"line-translate": [
1.75,
-2.25
],
"line-opacity": 0.78,
"line-width": 2.5,
"line-gap-width": 0.25
}
},
"_geometry": [
[
{
"x": 1036,
"y": 2998
},
{
"x": 1102,
"y": 3006
},
{
"x": 1145,
"y": 3002
},
{
"x": 1188,
"y": 2987
},
{
"x": 1253,
"y": 2957
},
{
"x": 1301,
"y": 2924
},
{
"x": 1345,
"y": 2880
},
{
"x": 1381,
"y": 2829
},
{
"x": 1411,
"y": 2769
},
{
"x": 1424,
"y": 2712
},
{
"x": 1428,
"y": 2654
},
{
"x": 1423,
"y": 2583
},
{
"x": 1335,
"y": 2199
},
{
"x": 1322,
"y": 2135
},
{
"x": 1320,
"y": 2086
},
{
"x": 1320,
"y": 2044
},
{
"x": 1329,
"y": 1999
},
{
"x": 1336,
"y": 1979
},
{
"x": 1343,
"y": 1958
},
{
"x": 1385,
"y": 1875
},
{
"x": 1400,
"y": 1854
},
{
"x": 1453,
"y": 1814
},
{
"x": 1545,
"y": 1753
},
{
"x": 1649,
"y": 1723
},
{
"x": 1739,
"y": 1711
},
{
"x": 1869,
"y": 1715
},
{
"x": 1915,
"y": 1717
},
{
"x": 2135,
"y": 1741
},
{
"x": 2309,
"y": 1783
},
{
"x": 2499,
"y": 1841
},
{
"x": 2657,
"y": 1901
},
{
"x": 2827,
"y": 1993
},
{
"x": 3117,
"y": 2173
},
{
"x": 3234,
"y": 2243
}
]
]
} |
* layer information * source information * layout properties * calculated paint properties Fixes #876
848c933
to
7924698
Compare
Per #876, this adds a
_bucketType
property to features returned inmap.featuresAt
that indicates the layer type specified in the stylesheet, so it would return something likeThis is a really simple fix for the specific problem I'm having in a project, but I think requires further discussion on the actual intent/use for
featuresAt
— is this 👍 or should it return more info? (Also, if this is sufficient, we should probably rename the returned_type
property —_geometryType
?)cc @jfirebaugh @ansis @kkaefer @edenh @mourner @tmcw