Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add Location Indicator layer - #16340

Merged
galinelle merged 4 commits into
masterfrom
galinelle_locationComponent
Apr 8, 2020
Merged

galinelle merged 4 commits into
masterfrom
galinelle_locationComponent

Conversation

@galinelle

@galinelle galinelle commented Mar 25, 2020 •

Copy link
Copy Markdown
Contributor

Launch Checklist

  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • tagged @mapbox/maps-android @mapbox/maps-ios @mapbox/core-sdk if this PR adds or updates a public API
  • tagged @mapbox/gl-js if this PR includes shader changes or needs a js port
  • apply needs changelog label if a changelog is needed (remove label when added)

@galinelle
galinelle requested a review from alexshalamov March 25, 2020 15:37
@galinelle
galinelle force-pushed the galinelle_locationComponent branch 2 times, most recently from a212677 to 0159552 Compare March 25, 2020 23:45
@galinelle galinelle changed the title WIP: puck WIP: location component Mar 25, 2020
@galinelle
galinelle force-pushed the galinelle_locationComponent branch 3 times, most recently from 4b9e1b7 to 3c51a80 Compare March 26, 2020 11:21
@galinelle galinelle changed the title WIP: location component Add Location Component layer Mar 26, 2020
@galinelle
galinelle force-pushed the galinelle_locationComponent branch from 3c51a80 to 0385b33 Compare March 26, 2020 11:50
@galinelle
galinelle force-pushed the galinelle_locationComponent branch from 0385b33 to c11f652 Compare March 26, 2020 14:41
@chloekraw
chloekraw requested a review from LukasPaczos March 26, 2020 16:13
@chloekraw

Copy link
Copy Markdown
Contributor

cc @mapbox/maps-android @mapbox/maps-ios

@knov
knov requested review from fabian-guerra and julianrex March 26, 2020 16:50
@galinelle
galinelle force-pushed the galinelle_locationComponent branch 10 times, most recently from c093475 to ecca894 Compare March 27, 2020 12:28
Comment thread include/mbgl/style/position.hpp Resolved
Comment thread platform/glfw/glfw_view.cpp Resolved
Comment thread platform/glfw/glfw_view.cpp Resolved
Comment thread platform/glfw/glfw_view.cpp Resolved
@galinelle
galinelle force-pushed the galinelle_locationComponent branch 2 times, most recently from 9a657b9 to 5539c79 Compare March 27, 2020 13:09
Comment thread scripts/style-spec.js Resolved
Comment thread scripts/style-spec.js Resolved
@galinelle
galinelle force-pushed the galinelle_locationComponent branch 2 times, most recently from abda85d to a7f40b1 Compare April 1, 2020 21:05
Comment thread platform/glfw/glfw_view.cpp Resolved
Comment thread platform/glfw/glfw_view.cpp Resolved

class RenderLocationIndicatorImpl {
protected:
struct vec2 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a generic class, don't we already have it (or shall be put to a generic place)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the closest seems to be Point, missing methods such as normalize(d) and length

@galinelle
galinelle force-pushed the galinelle_locationComponent branch 18 times, most recently from 3cbea18 to a6f9351 Compare April 5, 2020 11:15
Gali Nelle added 4 commits April 8, 2020 01:53
New key is "G" in mbgl-glfw, cycling between no puck, centered
in the viewport and positioned in Tokyo.
This change introduces a new property type, Rotation, that uses
a custom interpolator, and that is currently applied to
all style properties named "bearing", with a period attribute.

@pozdnyakov pozdnyakov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

"top-image-size" : 16,
"shadow-image-size" : 112,

"accuracy-radius-color": "rgba(255,0,0,0.2)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you test zoom dependent radius color or image size? Using interpolate or step expression https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#interpolate ?

"location" : [ 35.693055, 139.766707, 0],
"accuracy-radius": 90.0,
"bearing-image-size" : 48,
"top-image-size" : 16,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all image-size properties should be a scale factor, similar to icon-size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename to image-scale then? calling these properties -size seems def. wrong

Comment on lines +51 to +56
"accuracy-radius-transition": { "duration": 0, "delay": 0 },
"bearing-image-size-transition": { "duration": 0, "delay": 0 },
"top-image-size-transition": { "duration": 0, "delay": 0 },
"shadow-image-size-transition": { "duration": 0, "delay": 0 },
"accuracy-radius-color-transition": { "duration": 0, "delay": 0 },
"accuracy-radius-border-color-transition": { "duration": 0, "delay": 0 },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these could be removed, from all tests

namespace {
const std::string mbglPuckAssetsPath{MAPBOX_PUCK_ASSETS_PATH};

mbgl::Color premultiply(mbgl::Color c) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use multiplication operator for color.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems to multiply also alpha

Comment thread scripts/style-spec.js
Comment on lines +38 to +62
"perspective-compensation": {
"type": "number",
"default": "0.85",
"property-type": "data-constant",
"expression": {
"interpolated": true,
"parameters": [
"zoom"
]
},
"doc": "The amount of the perspective compensation, between 0 and 1. A value of 1 produces a location indicator of constant width across the screen. A value of 0 makes it scale naturally according to the viewing projection."
},
"image-tilt-displacement": {
"type": "number",
"property-type": "data-constant",
"default": "0",
"units": "pixels",
"expression": {
"interpolated": true,
"parameters": [
"zoom"
]
},
"doc": "The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence."
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these properties are purely related to rendering, could be converted to paint properties?

Comment thread src/mbgl/gl/defines.hpp Resolved
Comment thread scripts/style-spec.js
},
"bearing-image-size": {
"type": "number",
"units": "pixels",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to scale factor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants