mapbox / mapbox/mapbox-annotation-extension

MGLSymbolStyleAnnotation not showing up

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C
Stars
11
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Hi!

First of all, thanks for this great lib.

I am trying to display a MGLSymbolStyleAnnotation without success. I tried with the other StyleAnnotation like the Circle one and it's working perfectly.

Bellow my piece of test code:
```
MGLSymbolAnnotationController *symbolController = [[MGLSymbolAnnotationController alloc] initWithMapView:mapView];

MGLSymbolStyleAnnotation *symbolAnnotation = [[MGLSymbolStyleAnnotation alloc] initWithCoordinate:CLLocationCoordinate2DMake(46, 0)];
symbolAnnotation.text = @"TEST";
symbolAnnotation.textFontSize = 16;
symbolAnnotation.textHaloColor = UIColor.brownColor;
symbolAnnotation.textColor = UIColor.blueColor;
[symbolController addStyleAnnotation:symbolAnnotation];
```

There is no image attached to this Symbol but it's on purpose. I of course tried by attaching an image but same result, the annotation is not showing up. This piece of code is well located in the `didFinishLoadingStyle` callback.

Thank you in advance.

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

Start with the MGLSymbolAnnotationController and MGLSymbolStyleAnnotation setup in the didFinishLoadingStyle callback, comparing it with the working Circle style annotation path. Verify the behavior with and without an image, and consider the issue resolved when the symbol's text or image renders on the map.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.