maptalks / maptalks/maptalks.js

enableAltitude and heightFactor support for GL layers

Open
#2,510 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
HTML
Stars
4.5k
Forks
511
Avg merge
3d 58m
Merged PRs (30d)
1

Description

Related to #2486. Pulled from this comment https://github.com/maptalks/maptalks.js/issues/2486#issuecomment-2566833124 as a separate issue for tracking.

I need to disable parallax effect for the top view, it was a big part of UX. This worked for VectorLayer but doesn't work for PointLayer:

```js
if (enableAltitude && autoAltitude) {
markerLayer.setOptions({enableAltitude: map.getPitch()!=0});
}
```
See https://joric.github.io/maps/fallout-london/ (VectorLayer) vs https://joric.github.io/stalker/ (PointLayer)

Also heightFactor doesn't seem to work AT ALL, even as a static property. It would be great to change heightFactor dynamically too.

**Upd.** heightFactor works as a global map option in v0.111.0, but if changed it doesn't affect already added layers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using the linked VectorLayer and PointLayer examples, then trace how enableAltitude and heightFactor are handled for each layer. Verify top-view parallax disabling and dynamic heightFactor changes for already added layers; done means both options behave consistently without requiring layers to be recreated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.