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
2 answers

Custom map path line

I'm having trouble with drawing a line on the map with a stroke. (inside color and outside color) I beleive i'm on the right path and have subclassed mkOverlayView to override the drawing (needs to fill with the road size) so inside…
glued
  • 2,579
  • 1
  • 25
  • 40
3
votes
1 answer

MKPolygon ontouch detailview

I've created a MKMapView with MKPolygons based on coordinates. There are multiple polygons on the map (look here for an example of what I am re-creating as an app). What I am trying to do is when the user touches the polygon, it opens a popover…
Dwill
  • 506
  • 1
  • 5
  • 22
3
votes
0 answers

DrawMapRect called multiple times on a custom MKOverlayView

Anyone ever resolved this issue here iOS - MKOverlayView custom view rect fills works, but line draws do not? I am stuck with the same problem. The canDrawMapRect is called only once and returns YES . Butthe drawMapRect method is called twice with…
3
votes
2 answers

MonoTouch Mapkit image overlay

I have been looking for a good tutorial on adding an image overlay for Mapkit in C# Monotouch. I have found many overlay examples for coloured circles or polygons. But I want to load a PNG over the top of my maps. I am coming from MonoAndroid and…
3
votes
2 answers

draw line on MKMapView with pattern image

I try to draw a line on a MKMapView with a pattern image. The drawing is done by adding a custom MKMapOverlay view. I'm able to get the line drawn, but it seems that the drawing is done using only the left, topmost pixel of the pattern image,…
EsbenB
  • 3,356
  • 25
  • 44
3
votes
1 answer

MKMapView - Limit map scroll to a square overlay

I have a MKMapView with a square overlay described as: CLLocationCoordinate2D coordsBg[5]={ CLLocationCoordinate2DMake(31.750865,35.180882), CLLocationCoordinate2DMake(31.740331,35.180882), …
shannoga
  • 19,649
  • 20
  • 104
  • 169
3
votes
1 answer

Add two MKPolylineView

i am having trouble to add two different MKPolylineView with diferent colors in a MKOverlayView. Any ideas on how to achieve this? Thanks Here is my code: - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id…
pochimen
  • 287
  • 3
  • 15
2
votes
1 answer

Inverted MKPolygon (Inside Out)

I am working with MKPolygon and MKPolygonView as a map overlay for the first time. I can place a shape over an area, and the fill color fills the interior of the polygon. I am looking for a way to put the fill everywhere on my map except the…
Jim
  • 5,940
  • 9
  • 44
  • 91
2
votes
1 answer

MKOverlayView performance

I am adding about 3000 MKOverlays to my map, and as you can imagine, it takes a while, up to about eight seconds sometimes. I'm looking for a way to use threading to improve performance, so the user can move the map around while overlays are being…
2
votes
1 answer

Trouble with overlay using MKPolyline & MKPolylineView

I have added an overlay to my MKMapView using the addOverlay: method. The overlay was made using MKPolyline and stroked using MKPolylineView. The stroke color is blue, with an alpha value of 0.7. When the view initially loads, the overlay is drawn…
Johnny Gamez
  • 259
  • 6
  • 19
2
votes
1 answer

CGMutablePathRef changing colour

I am using the example Apple provide in one of their samples for drawing a CGPath on an MKOverlayView. At the moment the line draws as a single colour but I would like to set this at different points along the path. -…
Lee Armstrong
  • 11,420
  • 15
  • 74
  • 122
2
votes
1 answer

Show callout&pin when tapping overlay

Im trying to show a callout when user taps on an overlay. The callout then has a title on it based on the selected overlay. I want the annotations to be shown only when users taps on an overlay. but the problem is that the overlay doesnt recognize…
user1012032
2
votes
2 answers

MKMapView overlay does not display on map

My app gets the points for a route from google. The response also contains the bounding rect. My app creates the rect and shows the map correctly and I add the overlay. The - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id…
Ron Hooper
  • 21
  • 1
  • 4
2
votes
1 answer

Custom core-graphics overlay within MKMapView: can't display stroked ellipse

I'm trying to draw a series of concentric circles as a custom overlay within a MKMapView. Please note that for performance reasons, I need to implement a custom draw method, not simply add a series of MKCircleViews. I have the following code, and I…
John
  • 10,837
  • 17
  • 78
  • 141
2
votes
1 answer

How can I rotate and translate/scale an overlay so it matches the map rect?

I have an app where users can add an image to a map. This is pretty straightforward. It becomes much more difficult when I want to add rotation (taken from the current map heading). The code I use to create an image is pretty straightforward: let…
vrwim
  • 13,020
  • 13
  • 63
  • 118