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.

354 questions
4
votes
1 answer

Unable to draw MKPolylineView crossing longitude +/-180

I'm having a problem drawing an MKPolylineView on an MKMapView. The line represents a trip around the world, which begins and ends near New York, always traveling east. One leg of the trip, from Japan to San Francisco, crosses the Pacific ocean,…
Jack Bransfield
  • 117
  • 2
  • 8
4
votes
0 answers

MapKit: rendering MKCircle with unwelcome artifacts

I'm using MKCircle for displaying the user location on MKMapView. This is done by a few lines of code: MKCircle creation: self.mapCircle = MKCircle(center: pinLocation, radius: 50) self.mapView.add(self.mapCircle!) Rendering, using…
4
votes
0 answers

Multiple MKPolyline changes color after zoom level changes

I have an incoming data of 25 lines per second. Each line has gps data and altitude data. These lines are parsed and converted into mkpolylines and add as an overlay to map. Each polyline has a different color according to the altitude level. So…
Koray Birand
  • 1,836
  • 14
  • 22
4
votes
5 answers

swift remove map overlays

I am trying to remove overlays from map. func removeMapOverlay() { var removeOverlays : [AnyObject]! = self.mapView.overlays // Above line throws runtime exception self.mapView.removeOverlays(removeOverlays) } self.mapView.overlays…
Kampai
  • 21,517
  • 19
  • 87
  • 90
4
votes
1 answer

can not override GetRendererForOverlay on monotouch

I want to draw an overlay on top of my MKMapView So I defined this delegate class for defining the view of overlays. but as you can see it seems that from iOS 7 it is recommended that we use GetRendererForOverlay instead of GetViewForOverlay. The…
Husein Behboudi Rad
  • 5,114
  • 10
  • 51
  • 110
4
votes
1 answer

Prevent annotation deselected when overlay tapped

On my mapview I draw polygon overlays that belong to a specific annotation. I want that annotation to be selected when the overlay is tapped. My first attempt was to add a UITapGestureRecognizer to the mapview, test whether the tapped point is…
sgvd
  • 3,489
  • 14
  • 26
4
votes
1 answer

Custom MKOverlay with radius in meters

I made a custom overlay by making an NSObject subclass that conforms to the MKOverlay Protocol and a subclass of MKOverlayPathRenderer. My goal was to make a circular overlay that anchored to the user location on an MKMapView and I have that working…
barndog
  • 6,314
  • 8
  • 45
  • 90
4
votes
0 answers

Adding/removing MKCircle is choppy/slow, trying to simulate resizing

So the radius property of MKCircle is read-only, necessitating that any resizing be done via removal of the original MKCircle from the map view, and adding the new one. To make things smoother, I am adding the new circle to the map view before…
ray
  • 1,748
  • 2
  • 20
  • 36
4
votes
2 answers

Performance issues with MapKit on iOS6

After updating to iOS 6 I have noticed sever performance decreases when panning or zooming a MKMapView with multiple overlays. An app I created has approximately 600 polygon overlays of various colours, and ran lag-free (even on older iOS devices)…
Tom H
  • 1,354
  • 14
  • 25
4
votes
1 answer

Sending 'MKOverlayView to parameter of incompatible type 'id'

I'm getting the following warning when adding overlays to my map view: Sending 'MKOverlayView *const __strong' to parameter of incompatible type 'id' The code works great, and the overlays are drawn as they should, but I would love to…
La bla bla
  • 8,260
  • 9
  • 57
  • 101
4
votes
1 answer

Adding multiple overlays to MKMapView

I am having some trouble understanding how to add multiple overlays to MKMapView. I have an array routes tracked. The routes tracked are arrays of CLLocations. So I have an array of arrays. I am able to take one route and draw it on the map view.…
random
  • 8,428
  • 12
  • 46
  • 81
3
votes
3 answers

How to distinguish two MKPolyline's in viewForOverlay:

I am loading multiple MKPolylines as overlays onto an MKMapView. I would like to be able to distinguish these some how so change things like color, line width, etc. But, when viewForOverlay: gets called, it sees all my MKPolylines the same, which…
Nic Hubbard
  • 39,231
  • 60
  • 236
  • 403
3
votes
1 answer

Creating a MKPolygon from user-placed annotations in map

I want the user to be able to create polygons after placing some (unknown number) MKpointAnnotations in the map.I have put a gesture recognizer that gets activated once the user taps a button, and so annotations are placed.But how to use these as…
user1003502
3
votes
1 answer

Saving MKOverlayView array -> plist

I have an application that involves lots of MKOverlayViews. Every time one is added to the map, it is also added to an NSArray. When the user wishes to stop adding overlays, I would like for them to be able to save them, and be able to access them…
eric.mitchell
  • 8,501
  • 12
  • 50
  • 91
3
votes
3 answers

Getting Memory Warning Level 2 using overlay view with MapKit

I have a problem concerning memory warnings on the iPhone. I remove overlays and insert new ones. This happens every 5 seconds. But after a while, like half a minute, I get a memory warning and my app crashes. What could I do, the subview of my…
Simon
  • 31
  • 2