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

Custom user location image (ios) #2272

Closed
kajensen opened this issue Sep 8, 2015 · 2 comments
Closed

Custom user location image (ios) #2272

kajensen opened this issue Sep 8, 2015 · 2 comments
Labels
feature iOS Mapbox Maps SDK for iOS

Comments

@kajensen
Copy link

kajensen commented Sep 8, 2015

Hi, i'm seeing if anyone has an implementation for a custom user location annotation image. Its actually kind of funny/awesome- if you set a (custom subclassed) annotation on the exact userlocation coordinate with userlocation tracking heading enabled, it rotates, which is exactly what I want. But it still shows the user location annotation (blue dot), which is unfortunate.

I think it would be awesome if you could set the user location image just like another annotation via [mapView: imageForAnnotation:].

Anyways, i'm trying to do this myself but when I add the platform/ios files to an xcode project it won't compile as its missing numerous .h and .m files. I'm new to this, and I'm not really sure how to get started, so if anybody is willing to help i'd appreciate it.

@incanus
Copy link
Contributor

incanus commented Sep 8, 2015

Hi @kajensen. Proper support for this will be added in #1784, but in the meantime, what we are doing now on iOS is not an image but actually is drawn on the fly in Core Graphics in order to take advantage of some animations and the tintColor API. You want to customize the MGLUserLocationAnnotationView class, which right now isn't very direct nor supported, but is a way that you could hack this.

@incanus incanus closed this as completed Sep 8, 2015
@incanus incanus added feature iOS Mapbox Maps SDK for iOS labels Sep 8, 2015
@1ec5
Copy link
Contributor

1ec5 commented May 14, 2016

I think it would be awesome if you could set the user location image just like another annotation via [mapView: imageForAnnotation:].

Filed #5037 for the preferred implementation, now that we support annotation views.

Anyways, i'm trying to do this myself but when I add the platform/ios files to an xcode project it won't compile as its missing numerous .h and .m files. I'm new to this, and I'm not really sure how to get started, so if anybody is willing to help i'd appreciate it.

We overhauled the build system in #4641, simplifying the project structure considerably. Please have a look at DEVELOPING.md for guidance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants