0

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). so for example this image would have a green point a red point and a blue point and the colors mix in the center. Up until now I have been using MKPolygon. Any Guidance will be appreciated.

Thanks,

Igal Flegmann
  • 582
  • 1
  • 8
  • 19
  • Isn't that exactly what all the OpenGL tutorials do? You could look into EAGLView. – Putz1103 Jun 14 '16 at 17:22
  • No, I am trying to do the overlay on top of a map based on points that the user clicks. but thanks for the help – Igal Flegmann Jun 14 '16 at 17:32
  • OpenGL can do that... – Putz1103 Jun 14 '16 at 17:34
  • Could you guide me in the right direction? I can't find any tutorials of openGL with mapkit – Igal Flegmann Jun 14 '16 at 17:52
  • You don't need a tutorial involving MapKit. You are just going to create a completely new view on top of your Map View. Once you can do that then you can make the Overlay view do whatever you want it to. It won't be easy, but nothing good is easy. – Putz1103 Jun 14 '16 at 17:57
  • 1
    I need it to work like the mkpolygon so be based on coordinates and adjust with the map. is that possible with another view? – Igal Flegmann Jun 14 '16 at 18:02

1 Answers1

0

To Achieve my result I wrote a for loop that iterated through all the points, which had a for loop inside that subtracted a value from the other points to make the polygon smaller and created a polygon this was done until the polygon was small enough for the view. This gave it a nice gradient and doing it for the other cornea with different colors gave the desired gradient of colors.

Igal Flegmann
  • 582
  • 1
  • 8
  • 19