Questions tagged [mkpolygon]

The MKPolygon class (iOS Developer Library) represents a shape consisting of one or more points that define a closed polygon

The MKPolygon class represents a shape consisting of one or more points that define a closed polygon. The points are connected end-to-end in the order they are provided. The first and last points are connected to each other to create the closed shape.

When creating a polygon, you can mask out portions of the polygon by specifying one or more interior polygons. For the polygons you specify, this class uses the even-odd fill rule to determine the final occupied area. When applied to overlapping polygons, this rule can cause specific regions to be masked out (and thereby removed) from the total occupied area.

68 questions
1
vote
0 answers

MKPolygon and point contains

I have a KML file that contains all the polygons coordinates for all countries. Some countries have more than 1 tag. What I am trying to accomplish here is to get a coordinates and find in which polygon is located. I got an idea on…
user622203
  • 149
  • 6
  • 20
1
vote
1 answer

Converting MKPolygon Objective-C code to Swift

I have the following Objective-C method: - (void)addPolygonToMap { NSInteger numberOfPoints = [self.coordinates count]; if (numberOfPoints > 4) { CLLocationCoordinate2D points[numberOfPoints]; for (NSInteger i = 0; i <…
gotnull
  • 26,454
  • 22
  • 137
  • 203
1
vote
1 answer

Create Square Overlay that covers current region in MKMapView

How can I create a Square Overlay that will cover the current region of my MKMapView. My MKMapView is set with coordinates of the users current location but they are centre coordinates. How do I calculate the square coordinates so I can create a…
Stephen Bennett
  • 431
  • 6
  • 17
1
vote
0 answers

Draw multiple MKCircle in MapView iphone sdk

I want to draw multiple MKCircle in mapview but it cause memory problem. I found a solution to reduce memory consommation but it's for MKPolygon in this link MKMapView with multiple overlays memory-issue My problem is that i want to use it for…
aminovic09
  • 81
  • 1
  • 6
1
vote
1 answer

check current location is in MkPolygons

I am working in an IOS 7 project ,it contains a location checking (current location is in given polygons). I am Using the following code to check the condition Created an array of MKPolygons for(MKPolygon *poly in self.polygonArray) { …
John
  • 734
  • 3
  • 14
  • 30
1
vote
1 answer

Create MKPolygon dynamically

I am working with MKPolygon for having overlay on UIMapView. Below is my current code : CLLocationCoordinate2D commuterLotCoords[5]={ CLLocationCoordinate2DMake(39.048019,-76.850535), CLLocationCoordinate2DMake(39.048027,-76.850234), …
Ankita Shah
  • 2,178
  • 3
  • 25
  • 42
1
vote
0 answers

MKPolygonRenderer - tough memory issues

i am currently facing a hard memory issue while using the new iOS7 MKPolygonRenderer class.. I pinpointed the source of the issue to a single line of code: [renderer invalidatePath]; it seems like the core framework is not releasing the memory…
1
vote
1 answer

Multiple Polygon overlays from array

I have an array with polygons created from a data file with coordinates per polygon. So when I plot them on my map I use: [mapView addOverlays:polygonArray]; and in my viewForOverlay: if ([overlay isKindOfClass:[MKPolygon class]]) { …
wkberg
  • 391
  • 2
  • 12
1
vote
1 answer

Convert MKPolygon to UIBezierPath

Is there a way to convert an MKPolygon to a UIBezierPath? I have an MKPolygon that is using latitude and longitude coordinates to make up its points. How would those latitude/longitude coordinates translate to coordinates on a UIView?
tentmaking
  • 2,076
  • 4
  • 30
  • 53
1
vote
2 answers

Draw a GMSPolyline with a background color

I see that the GMSPolyline protocol already defines a color property for its stroke color, but is there a way to shade the inside of its polygon (ideally with transparency)? I’m looking for a Google Maps equivalent to MKPolygon and friends.
Jeff Kelley
  • 19,021
  • 6
  • 70
  • 80
0
votes
0 answers

Utilizing MKOverlay `canReplaceMapContent` on only part of the MKMap content

I have created an overlay that I want to cover the whole world except a specific region where the app is focused. I subclassed MKPolygon as follows: class ReplacingPolygion:MKPolygon{ override func canReplaceMapContent()->Bool{ return…
Aleksandr
  • 533
  • 1
  • 4
  • 12
0
votes
0 answers

Multiple MKPolygon changes color after zoom level changes

Hello i am working on map related app in which i have to draw multiple polygon on mk mapview. it's load fine at first time . As you can see in image.but if i change the zoom level all the colours are changed in mapview as shown in picture…
vipal
  • 1
  • 1
0
votes
2 answers

What is the designated initializer for a MKPolygon in Swift4?

I'm trying to set up a class that inherits from MKPolygon as below, but the compiler rejects my call to super.init() with the following error message: Must call a designated initializer of the superclass 'MKPolygon' What is the designated…
RP-3
  • 684
  • 4
  • 22
0
votes
2 answers

Converting a single string with coordinates into an array of CLLocationCoordinate2D and use the array to generate Polygons in a mapView

I'm receiving this JSON: JSON: { "status_code" : 200, "status" : "ok", "data" : [ { "zona" : "Narvarte", "hora" : "", "id_zona" : 1423, "proxdia" : "Lunes 20 de Febrero, 2017", "coor" : "(19.452187074041884,…
0
votes
1 answer

Multi Color Polygon in iOS

Hi I am trying to implement a polygon with a color gradient based on the color of each corner (the polygon is an overlay for a map). Up until now I have been using MKPolygon. Any Guidance will be appreciated. Thanks,
Igal Flegmann
  • 582
  • 1
  • 8
  • 19