mapbox / mapbox/mapbox-maps-ios

Order of operations with iconOffset and iconRotate

Open
#1,983 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature :green_apple:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## New Feature

This may well be user error, but in my map I have a `SymbolLayer` that I want to set the offset and rotate of the image on.

This used to be updated relatively infrequently, so what I did was:
1. Rotate the image as desired using UIKit methods
2. Offset the image as desired using `iconOffset` property of the `SymbolLayer`.

Since this image is now updated more frequently, I switched the implementation to:
Assign `iconRotate` and `iconOffset` properties on the `SymbolLayer` as appropriate.

However, the implementation appears to apply in this order:
1. Offset
2. Rotate

Which results in behavior that isn't desired. I also attempted to use `iconTranslate` with similar effects.

It would be nice to specify the order of operations of the image to choose between "spinning and moving" vs "orbiting".

There are plenty of resources on this but if it helps, here is one:
https://bobobobo.wordpress.com/2011/12/20/rotation-translation-vs-translation-rotation/

Is there a path I'm missing? Maybe this is already possible?

## Why

I would like to be able to specify rotation and offset for images in either order based on the business case.

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

No files or tests are named. Start with SymbolLayer's iconRotate, iconOffset, and iconTranslate behavior, comparing it with the UIKit image-transform workflow described; define how users would select each operation order and verify both resulting map behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
computer-graphics, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.