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

Add Location Indicator layer #16340

Merged
merged 4 commits into from
Apr 8, 2020
Merged

Add Location Indicator layer #16340

merged 4 commits into from
Apr 8, 2020

Conversation

galinelle
Copy link
Contributor

@galinelle galinelle commented Mar 25, 2020

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 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
@chloekraw
Copy link
Contributor

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

@galinelle galinelle force-pushed the galinelle_locationComponent branch 10 times, most recently from c093475 to ecca894 Compare March 27, 2020 12:28
include/mbgl/gl/location_component_layer.hpp Outdated Show resolved Hide resolved
include/mbgl/style/position.hpp Outdated Show resolved Hide resolved
platform/glfw/glfw_view.cpp Outdated Show resolved Hide resolved
platform/glfw/glfw_view.cpp Outdated Show resolved Hide resolved
platform/glfw/glfw_view.cpp Outdated Show resolved Hide resolved
src/mbgl/gl/location_component_layer_impl.hpp Outdated Show resolved Hide resolved
src/mbgl/gl/location_component_layer.cpp Outdated Show resolved Hide resolved
src/mbgl/gl/location_component_layer.cpp Outdated Show resolved Hide resolved
include/mbgl/gl/location_component_layer.hpp Outdated Show resolved Hide resolved
src/mbgl/gl/location_component_layer_impl.hpp Outdated Show resolved Hide resolved
@galinelle galinelle force-pushed the galinelle_locationComponent branch 2 times, most recently from 9a657b9 to 5539c79 Compare March 27, 2020 13:09
@galinelle galinelle force-pushed the galinelle_locationComponent branch 19 times, most recently from baceaca to 5e013ca Compare April 7, 2020 21:56
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.
@galinelle galinelle force-pushed the galinelle_locationComponent branch from 5e013ca to 3ceca27 Compare April 7, 2020 23:07
Copy link
Contributor

@pozdnyakov pozdnyakov left a comment

Choose a reason for hiding this comment

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

:shipit:

@galinelle galinelle merged commit fe9ba47 into master Apr 8, 2020
@galinelle galinelle deleted the galinelle_locationComponent branch April 8, 2020 11:00
"top-image-size" : 16,
"shadow-image-size" : 112,

"accuracy-radius-color": "rgba(255,0,0,0.2)",
Copy link
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
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
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
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
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
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 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
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?

src/mbgl/gl/defines.hpp Show resolved Hide resolved
},
"bearing-image-size": {
"type": "number",
"units": "pixels",
Copy link
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