Questions tagged [mkoverlay]

MKOverlay is part of Apple's Map Kit framework for developing iOS applications. The primary purpose of MKOverlay is to add one or more visual overlays to an existing MKMapView (base map). There are different kinds of overlays, like circles (MKCircle), polylines (MKPolyline), polygons (MKPolygon) or custom overlays as offline maps.

MKOverlay is part of Apple's Map Kit framework for developing iOS applications. The primary purpose of MKOverlay is to add one or more visual overlays to an existing MKMapView (base map). There are different kinds of overlays, like circles (MKCircle), polylines (MKPolyline), polygons (MKPolygon) or custom overlays as offline maps.

359 questions
3
votes
0 answers

How to set image overlay in WKInterfaceMap over a MapRect

I m trying to add image overlay on a specific area (say United states) in WKInterfaceMap object of Watchkit. In iOS using MKMapView I can add image overlay as: I have two custom class ImageOverlay & ImageOverlayRenderer class ImageOverlay:…
M Zubair Shamshad
  • 2,741
  • 3
  • 23
  • 45
3
votes
0 answers

weird mapView overlay draw behavior when zooming out

This is what happens when I try to zoom out. this was not happening on ios9 and honestly I'm not sure what to look for. the overlay is an MKGeodesicPolyline which i add to the mapview like so self.mapview.add(polylineOverlay).
Massimo
  • 159
  • 1
  • 10
3
votes
0 answers

Odd behaviour with MKOverlayRenderer

I'm working on a project that uses MKMapView and requires quite a few overlays, and ran into some odd behaviour while rendering the overlays onto the map. The delegate method is quite standard: func mapView(mapView: MKMapView, rendererForOverlay…
xoudini
  • 7,001
  • 5
  • 23
  • 37
3
votes
3 answers

Custom MKOverlayRenderer drawMapRect function not drawing polygons

I have built a custom MKOverlayRenderer in order to build polygons, apply a blend mode, then add them to the map view. In my drawMapRect function, I use an array of CGPoints to build the polygon, and create a path. However, during runtime nothing…
Jamesar
  • 47
  • 3
  • 8
3
votes
1 answer

MKMapViewDelegate: How to identifiy overlay in rendererForOverlay

I'm adding two different MKGeodesicPolyline instances to an MKMapView like this CLLocation *LAX = [[CLLocation alloc] ...]; CLLocation *JFK = [[CLLocation alloc] ...]; CLLocation *LHR = [[CLLocation alloc] ...]; CLLocationCoordinate2D…
hennes
  • 9,147
  • 4
  • 43
  • 63
3
votes
1 answer

How to refresh an MKOverlayRenderer when mapView change

I am new to code, and i'm trying to realize something like Reminders app : I've follow another answer to realize it and here my code: In my ViewController: var circle = MKCircle(centerCoordinate: location.coordinate, radius:…
grominet
  • 274
  • 1
  • 3
  • 13
3
votes
0 answers

Animated map overlay: How do I make an MKCircle expand from 0 to its full size when it gets added?

I would like to have my MKCircle expand from 0 to its specified radius size whenever it gets added to the map. MKOverlayRenderer is getting me a nice end result, but it adds the circle too spontaneously. I would like to animate it to have a smoother…
3
votes
2 answers

Round selection of location on the MKMapView

I want to implement a circular selection (with center and radius) on the MKMapView like it looks on the screenshot below. Should be possible to move the selection pulling the green pointer and change circle radius pulling the dark gray pointer. What…
d0ping
  • 462
  • 4
  • 16
3
votes
1 answer

iOS 8 SDK, Swift, MapKit Drawing a Route

I need to draw route between two points and I'm using MKDirectionsRequest for my purpose. Getting a route is OK, but I have trouble with drawing it. In iOS 8 SDK there's no function - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id…
esphynox
  • 33
  • 1
  • 8
3
votes
2 answers

MKMapView Zoom to Fit Overlays

I have an circle overlay on my MKMap, which the user can change the radius of. How can I make it so when the radius is changed the Map will automatically zoom to fit the new radius size. I have tried: _mapView.visibleMapRect =…
Stephen Bennett
  • 431
  • 6
  • 17
3
votes
1 answer

MKOverlayRenderer not rendering

I'm having trouble getting an MKPolygonRenderer to appear over my map. I have a class MapViewController that contains an MKMapView, and create CustomMapOverlay instances to render over the MKMapView. MapViewController.m: - (void)viewDidLoad { …
ericsoco
  • 24,913
  • 29
  • 97
  • 127
3
votes
0 answers

Two coloured/custom line on MKPolylineRenderer

I am drawing x amount of lines on an MKMapView. The data is being downloaded from a webservice and for each line that needs drawing I am creating a MKPolyline, adding it to an overlayArray (some overlays have more than one polyline) and finally…
Patrick
  • 6,495
  • 6
  • 51
  • 78
3
votes
1 answer

How to fill outside overlay circle in iOS 7 on map

I need the same filled space around circle on the map as in Reminders app in iOS7. I think need to use the method applyFillPropertiesToContext:atZoomScale or fillPath:inContext:.
buh
  • 440
  • 2
  • 12
3
votes
4 answers

Customizing MKTileOverlay for cached tiles

I'm trying to update my tile map code to use iOS 7's MKTileOverlay and MKTileOverlayRenderer, and I could use some pointers for making things work better. First, here is the iOS6 code: AppleTileOverlay.m and TileOverlayView.m. This still works quite…
RL2000
  • 913
  • 10
  • 20
3
votes
1 answer

MKOverlayView and changing its alpha

I have a custom MKOverlay and MKOverlayView. When the MKOverlayView is created, I can set the alpha of the view: -(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context { DatasetOverlay…
Padin215
  • 7,444
  • 13
  • 65
  • 103