Questions tagged [mglmapview]

27 questions
5
votes
0 answers

How To rotate Custom marker heading (Direction) of Mapbox map view

How can i change the direction (Heading) of the custom marker on Mapbox map on Swift. Here is my code func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? { var annotationImage =…
Kuldeep Mishra
  • 3,846
  • 1
  • 21
  • 26
3
votes
4 answers

How to bring UIButton to front of Mapbox view

I am using Mapbox SDK (SWIFT) and created my custom map. I added a button and image on the map in storyboard but when I run the application it seems like it is hidden behind. I tried everything including view.bringSubview(toFront:UIimage) and I…
marcoder
  • 31
  • 2
3
votes
2 answers

MGLMapView scaleBar position at bottom by updating constraints

By default MGLMapView puts the scaleBar view at the top left of the map. I would like to move it to the bottom left, but I am having issues with doing this. Either my NSLayoutConstraint code is wrong, or something else is happening. The scaleBar is…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
2
votes
1 answer

How can I detect a change in zoom level in mapbox map?

I am trying to change certain properties of a map and of things on a map when as the user zooms in or out certain distances. How can this be achieved? I have tried: func mapView(_ mapView: MGLMapView, didChange mode: MGLUserTrackingMode, animated:…
user10813210
2
votes
0 answers

How to draw a path for user foot steps in MapBox iOS SDK

I am using MapBox API for loading GeoJson data with the file. It's working fine. But, I have to draw a path for user footsteps, like from user current location, if he walks to somewhere in any direction need to draw a path. I have seen RMShape class…
2
votes
2 answers

Add a label on MGLPolygon

I have a situation where I need to draw an MGLPolygon on a map(MapBox) and I also want to give a UILabel like text on the polygon. The label has to be at the centroid of the polygon and it should be always visible. I found a code with which I can…
Alex
  • 538
  • 3
  • 18
1
vote
2 answers

Dealing with multiple annotations at the same address in an MGLMapView using SwiftUI and Mapbox

The thing is, I can't find any documentation on this--does anyone know if there is a way to neatly deal with annotations in the same spot (either so that you can like click the annotation or a button to cycle through the annotations at that spot or…
nickcoding
  • 305
  • 8
  • 35
1
vote
1 answer

MapBox: MGLineStyleLayer drawn over Annotations

I am trying to add Annotations and MGLineStyleLayer to the mapView. I am successfully adding them but the LineLayer is drawn above the annotations. I want the annotations to be drawn over the line layers. Here is my implementation /*This is where i…
Sarthak Mishra
  • 1,033
  • 1
  • 11
  • 27
1
vote
0 answers

Mapbox iOS connect MGLPolyline coordinates right

In my app I'm showing a path of a satellite's orbit. I understand I need to normalize the longitude of the coordinate when it crosses the meridian, but I can't seem to fund the correct formula. This results in the effect seen in the image. Can…
Zoltan Varadi
  • 2,468
  • 2
  • 34
  • 51
1
vote
0 answers

Can I use blending modes with MGLPolygon in Mapbox SDK?

I am working with MGLPolygon to have an overlay on mapView with Mapbox SDK. Below is my current code: - (UIColor *)mapView:(MGLMapView *)mapView fillColorForPolygonAnnotation:(MGLPolygon *)annotation { return [UIColor colorWithWhite:1.0…
Zgpeace
  • 3,927
  • 33
  • 31
1
vote
1 answer

How do I move the logo/watermark and the info button on MGLMapView?

I'm wondering how do I move Mapbox's logo and the info button up a little on the map view. But anything I do doesn't seem to affect the map --my first attempt to solve the problem let mapboxLogo = mapView.logoView mapView.logoView.isHidden…
Daniel Espina
  • 614
  • 11
  • 24
1
vote
1 answer

Using mapView:didAddAnnotationViews: from MKMapViewDelege and MGLMapViewDelegate errors

In my UIViewController I use both MKMapView and a MGLMapView. I need to use both of their delegate methods including mapView:didAddAnnotationViews: which is named the same for both maps. Xcode doesn't like this: Is it possible to use both of these…
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
0
votes
0 answers

How to add blur effect around the circle on the map Mapbox Maplibre GL Native

I have a map with a circle over the user location. Used Mapbox Maplibre GL Native. I want to add the blur around this circle, so inside circle will be no blur, but around all the map will be blured. I've created a blur effect and added this to the…
mozeX
  • 23
  • 7
0
votes
1 answer

How to zoom in and out with buttons on MGLMapView using Swift?

I'm a newbie and I am trying to make a simple map project. I want to zoom in and out with buttons on the map but it's not working. I already tried using MKMapView but I can't change MGLMapView to MKMapView. I tried to set a mglMapCamera variable in…
Eda
  • 23
  • 5
0
votes
1 answer

iOS Mapbox MGLMapView: fit an image to a MGLMapView

I used an UIImage to initialize an MGLImageSource. Then I use the MGLImageSource to initialize a MGLRasterStyleLayer and I add the layer to a MGLMapView. It turned out that the image is too big to fit entirely into the map view. How do I tell…
yuleo
  • 1
1
2