<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: getting ags point from opengl in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597166#M5206</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;solved this by making my painting class have a delegate method, and adding the delegate as a protocol into my main view controller.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the delegate method gets the mapview from the main view controller.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2012 16:52:16 GMT</pubDate>
    <dc:creator>HamzaHaroon</dc:creator>
    <dc:date>2012-08-22T16:52:16Z</dc:date>
    <item>
      <title>getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597147#M5187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need to get the ags point on the map (point with long and lat) on a opengl view. right now i have it to getting the user touch on the screen, which is x and y. how can this be done if my glview controlling class is seperate from the mapview controller?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is how i get input&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { CGRect bounds = [self bounds]; &amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch*&amp;nbsp;&amp;nbsp;&amp;nbsp; touch = [[event touchesForView:self] anyObject]; firstTouch = YES; // Convert touch point from UIView referential to OpenGL one (upside- down flip) location = [touch locationInView:self]; location.y = bounds.size.height - location.y; } // Handles the continuation of a touch. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGRect bounds = [self bounds]; UITouch* touch = [[event touchesForView:self] anyObject]; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Convert touch point from UIView referential to OpenGL one (upside- down flip) if (firstTouch) { firstTouch = NO; previousLocation = [touch previousLocationInView:self]; previousLocation.y = bounds.size.height - previousLocation.y; } else { location = [touch locationInView:self]; &amp;nbsp;&amp;nbsp;&amp;nbsp; location.y = bounds.size.height - location.y; previousLocation = [touch previousLocationInView:self]; previousLocation.y = bounds.size.height - previousLocation.y; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Render the stroke [self renderLineFromPoint:previousLocation toPoint:location]; } // Handles the end of a touch event when the touch is a tap. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { CGRect bounds = [self bounds]; &amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch*&amp;nbsp;&amp;nbsp;&amp;nbsp; touch = [[event touchesForView:self] anyObject]; if (firstTouch) { firstTouch = NO; previousLocation = [touch previousLocationInView:self]; previousLocation.y = bounds.size.height - previousLocation.y; [self renderLineFromPoint:previousLocation toPoint:location]; } }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is the code i have for drawing based on user touch&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;// Drawings a line onscreen based on where the user touches - (void) renderLineFromPoint:(CGPoint)start toPoint:(CGPoint)end { static GLfloat*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertexBuffer = NULL; static NSUInteger&amp;nbsp;&amp;nbsp; vertexMax = 64; NSUInteger vertexCount = 0, &amp;nbsp;&amp;nbsp;&amp;nbsp; count, &amp;nbsp;&amp;nbsp;&amp;nbsp; i; [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); // Convert locations from Points to Pixels CGFloat scale = self.contentScaleFactor; start.x *= scale;PaintingView.m 12-08-07 9:34 AM start.y *= scale; end.x *= scale; end.y *= scale; // Allocate vertex array buffer if(vertexBuffer == NULL) vertexBuffer = malloc(vertexMax * 2 * sizeof(GLfloat)); // Add points to the buffer so there are drawing points every X pixels count = MAX(ceilf(sqrtf((end.x - start.x) * (end.x - start.x) + (end.y -&amp;nbsp; start.y) * (end.y - start.y)) / kBrushPixelStep), 1); for(i = 0; i &amp;lt; count; ++i) { if(vertexCount == vertexMax) { vertexMax = 2 * vertexMax; vertexBuffer = realloc(vertexBuffer, vertexMax * 2 * sizeof (GLfloat)); } vertexBuffer[2 * vertexCount + 0] = start.x + (end.x - start.x) *&amp;nbsp; ((GLfloat)i / (GLfloat)count); vertexBuffer[2 * vertexCount + 1] = start.y + (end.y - start.y) *&amp;nbsp; ((GLfloat)i / (GLfloat)count); vertexCount += 1; } // Render the vertex array glVertexPointer(2, GL_FLOAT, 0, vertexBuffer); glDrawArrays(GL_POINTS, 0, vertexCount); // Display the buffer glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 16:49:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597147#M5187</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-14T16:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597148#M5188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can create AGSMutablePolyline or AGSMutablePolygon (based on geometry you want to draw) and keep adding AGSPoint converted from each touch (UITouch). Here is the code of conversion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- (AGSPoint*)getMapPointFromTouchs:(NSSet *)touches {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch *mytouch=[[touches allObjects] objectAtIndex:0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGPoint touchPoint = [mytouch locationInView:self];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *mapPoint = [self.mapView toMapPoint:touchPoint];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return mapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 15:19:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597148#M5188</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-15T15:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597149#M5189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i added that method, but I'm not getting any coordinates. i think its because i didn't set the mapView properly. here is my code for this class, and its header file. I'm new to arcgis and iOS, so i don't know how to properly set the mapView spatial reference to get the points based on touch.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#import &amp;lt;UIKit/UIKit.h&amp;gt;
#import &amp;lt;OpenGLES/EAGL.h&amp;gt;
#import &amp;lt;OpenGLES/ES1/gl.h&amp;gt;
#import &amp;lt;OpenGLES/ES1/glext.h&amp;gt;
#import &amp;lt;ArcGIS/ArcGIS.h&amp;gt;

//CONSTANTS:

#define kBrushOpacity&amp;nbsp; (1.0 / 3.0)
#define kBrushPixelStep&amp;nbsp; 1
#define kBrushScale&amp;nbsp;&amp;nbsp; 1
#define kLuminosity&amp;nbsp;&amp;nbsp; 0.75
#define kSaturation&amp;nbsp;&amp;nbsp; 1.0

//CLASS INTERFACES:

@interface PaintingView : UIView
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSMapView* _mapView;
 AGSGraphicsLayer* _graphicsLayer;
@private
 // The pixel dimensions of the backbuffer
 GLint backingWidth;
 GLint backingHeight;
 
 EAGLContext *context;
 
 // OpenGL names for the renderbuffer and framebuffers used to render to this view
 GLuint viewRenderbuffer, viewFramebuffer;
 
 // OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist)
 GLuint depthRenderbuffer;
 
 GLuint brushTexture;
 CGPoint location;
 CGPoint previousLocation;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *currentPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *previousPoint;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Boolean firstTouch;
 Boolean needsErase;
 AGSMutableMultipoint *lines;
}

@property(nonatomic, readwrite) CGPoint location;
@property(nonatomic, readwrite) CGPoint previousLocation;
@property(nonatomic, readwrite) AGSMutableMultipoint *lines;
//@property(nonatomic, retain) AGSMapView mapView;

- (void)erase;
- (void)setBrushColorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue;
- (void)update;

@end&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:38:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597149#M5189</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2021-12-12T01:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597150#M5190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//&amp;nbsp; PaintingView.m

#import &amp;lt;QuartzCore/QuartzCore.h&amp;gt;
#import &amp;lt;OpenGLES/EAGLDrawable.h&amp;gt;
#import "PaintingView.h"

//CLASS IMPLEMENTATIONS:

// A class extension to declare private methods
@interface PaintingView (private)

- (BOOL)createFramebuffer;
- (void)destroyFramebuffer;

@end

@implementation PaintingView

@synthesize&amp;nbsp; location;
@synthesize&amp;nbsp; previousLocation;
@synthesize&amp;nbsp; lines;

+ (Class) layerClass
{
 return [CAEAGLLayer class];
}

// The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
- (id)initWithCoder:(NSCoder*)coder mapView:(AGSMapView*) mapView graphicsLayer:(AGSGraphicsLayer*)graphicsLayer {
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; _mapView = mapView;
&amp;nbsp;&amp;nbsp;&amp;nbsp; _graphicsLayer = graphicsLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp; lines = [[AGSMutableMultipoint alloc] initWithSpatialReference:_mapView];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 NSMutableArray* recordedPaths;
 CGImageRef&amp;nbsp; brushImage;
 CGContextRef brushContext;
 GLubyte&amp;nbsp;&amp;nbsp; *brushData;
 size_t&amp;nbsp;&amp;nbsp; width, height;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((self = [super initWithCoder:coder])) {
&amp;nbsp; CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
&amp;nbsp; 
&amp;nbsp; eaglLayer.opaque = YES;
&amp;nbsp; // In this application, we want to retain the EAGLDrawable contents after a call to presentRenderbuffer.
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [NSNumber numberWithBool:YES], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
&amp;nbsp; 
&amp;nbsp; context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1];
&amp;nbsp; 
&amp;nbsp; if (!context || ![EAGLContext setCurrentContext:context]) {
&amp;nbsp;&amp;nbsp; [self release];
&amp;nbsp;&amp;nbsp; return nil;
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; // Create a texture from an image
&amp;nbsp; // First create a UIImage object from the data in a image file, and then extract the Core Graphics image
&amp;nbsp; brushImage = [UIImage imageNamed:@"Particle1.png"].CGImage;
&amp;nbsp; 
&amp;nbsp; // Get the width and height of the image

&amp;nbsp; width = 5;
&amp;nbsp; height= 10;
&amp;nbsp; 
&amp;nbsp; // Make sure the image exists
&amp;nbsp; if(brushImage) {
&amp;nbsp;&amp;nbsp; // Allocate&amp;nbsp; memory needed for the bitmap context
&amp;nbsp;&amp;nbsp; brushData = (GLubyte *) calloc(width * height * 4, sizeof(GLubyte));
&amp;nbsp;&amp;nbsp; // Use&amp;nbsp; the bitmatp creation function provided by the Core Graphics framework. 
&amp;nbsp;&amp;nbsp; brushContext = CGBitmapContextCreate(brushData, width, height, 15, width * 8, CGImageGetColorSpace(brushImage), kCGImageAlphaPremultipliedLast);
&amp;nbsp;&amp;nbsp; // After you create the context, you can draw the&amp;nbsp; image to the context.
&amp;nbsp;&amp;nbsp; CGContextDrawImage(brushContext, CGRectMake(0.0, 0.0, (CGFloat)width, (CGFloat)height), brushImage);
&amp;nbsp;&amp;nbsp; // You don't need the context at this point, so you need to release it to avoid memory leaks.
&amp;nbsp;&amp;nbsp; CGContextRelease(brushContext);
&amp;nbsp;&amp;nbsp; // Use OpenGL ES to generate a name for the texture.
&amp;nbsp;&amp;nbsp; glGenTextures(1, &amp;amp;brushTexture);
&amp;nbsp;&amp;nbsp; // Bind the texture name. 
&amp;nbsp;&amp;nbsp; glBindTexture(GL_TEXTURE_2D, brushTexture);
&amp;nbsp;&amp;nbsp; // Set the texture parameters to use a minifying filter and a linear filer (weighted average)
&amp;nbsp;&amp;nbsp; glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
&amp;nbsp;&amp;nbsp; // Specify a 2D texture image, providing the a pointer to the image data in memory
&amp;nbsp;&amp;nbsp; glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, brushData);
&amp;nbsp;&amp;nbsp; // Release&amp;nbsp; the image data; it's no longer needed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; free(brushData);
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; // Set the view's scale factor
&amp;nbsp; self.contentScaleFactor = 1.0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; // Setup OpenGL states
&amp;nbsp; glMatrixMode(GL_PROJECTION);
&amp;nbsp; CGRect frame = self.bounds;
&amp;nbsp; CGFloat scale = self.contentScaleFactor;
&amp;nbsp; // Setup the view port in Pixels
&amp;nbsp; glOrthof(0, frame.size.width * scale, 0, frame.size.height * scale, -1, 1);
&amp;nbsp; glViewport(0, 0, frame.size.width * scale, frame.size.height * scale);
&amp;nbsp; glMatrixMode(GL_MODELVIEW);
&amp;nbsp; glDisable(GL_DITHER);
&amp;nbsp; glEnable(GL_TEXTURE_2D);
&amp;nbsp; glEnableClientState(GL_VERTEX_ARRAY);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; glEnable(GL_BLEND);
&amp;nbsp; // Set a blending function appropriate for premultiplied alpha pixel data
&amp;nbsp; glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
&amp;nbsp; glEnable(GL_POINT_SPRITE_OES);
&amp;nbsp; glTexEnvf(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, GL_TRUE);
&amp;nbsp; glPointSize(width / kBrushScale);
&amp;nbsp; glColor4f(0.5f,0.1f,1.0f,1.0f);&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Make sure to start with a cleared buffer
&amp;nbsp; needsErase = YES;
&amp;nbsp; 
&amp;nbsp; // Playback recorded path, which is "Shake Me"
&amp;nbsp; recordedPaths = [NSMutableArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Recording" ofType:@"data"]];
&amp;nbsp; if([recordedPaths count])
&amp;nbsp;&amp;nbsp; [self performSelector:@selector(playback:) withObject:recordedPaths afterDelay:0.2];
 }
 [self setBackgroundColor:[UIColor clearColor]];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //self.userInteractionEnabled = NO;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return self;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}

-(void)layoutSubviews
{
 [EAGLContext setCurrentContext:context];
 [self destroyFramebuffer];
 [self createFramebuffer];
 
 // Clear the framebuffer the first time it is allocated
 if (needsErase) {
&amp;nbsp; [self erase];
&amp;nbsp; needsErase = NO;
 }
}

- (BOOL)createFramebuffer
{
 // Generate IDs for a framebuffer object and a color renderbuffer
 glGenFramebuffersOES(1, &amp;amp;viewFramebuffer);
 glGenRenderbuffersOES(1, &amp;amp;viewRenderbuffer);
 
 glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
 glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
 [context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(id&amp;lt;EAGLDrawable&amp;gt;)self.layer];
 glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
 
 glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &amp;amp;backingWidth);
 glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &amp;amp;backingHeight);
 
 glGenRenderbuffersOES(1, &amp;amp;depthRenderbuffer);
 glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
 glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);
 glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
 
 if(glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES) != GL_FRAMEBUFFER_COMPLETE_OES)
 {
&amp;nbsp; NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES));
&amp;nbsp; return NO;
 }
 return YES;
}

// Clean up any buffers we have allocated.
- (void)destroyFramebuffer
{
 glDeleteFramebuffersOES(1, &amp;amp;viewFramebuffer);
 viewFramebuffer = 0;
 glDeleteRenderbuffersOES(1, &amp;amp;viewRenderbuffer);
 viewRenderbuffer = 0;
 
 if(depthRenderbuffer)
 {
&amp;nbsp; glDeleteRenderbuffersOES(1, &amp;amp;depthRenderbuffer);
&amp;nbsp; depthRenderbuffer = 0;
 }
}

// Releases resources when they are not longer needed.
- (void) dealloc
{
 if (brushTexture)
 {
&amp;nbsp; glDeleteTextures(1, &amp;amp;brushTexture);
&amp;nbsp; brushTexture = 0;
 }
 
 if([EAGLContext currentContext] == context)
 {
&amp;nbsp; [EAGLContext setCurrentContext:nil];
 }
 
 [context release];
 [super dealloc];
}


// Erases the screen
- (void) erase
{
 [EAGLContext setCurrentContext:context];
 
 // Clear the buffer
 glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
 glClearColor(0.0, 0.0, 0.0, 0.0);
 glClear(GL_COLOR_BUFFER_BIT);
 
 // Display the buffer
 glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
 [context presentRenderbuffer:GL_RENDERBUFFER_OES];
}


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:38:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597150#M5190</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2021-12-12T01:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597151#M5191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// Drawings a line onscreen based on where the user touches
- (void) renderLineFromPoint:(AGSPoint*)astart toPoint:(AGSPoint*)aend//(CGPoint)start toPoint:(CGPoint)end
{
 static GLfloat*&amp;nbsp; vertexBuffer = NULL;
 static NSUInteger vertexMax = 64;
 NSUInteger&amp;nbsp;&amp;nbsp; vertexCount = 0, count, i;
 CGPoint start = [_mapView toScreenPoint:astart];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGPoint end = [_mapView toScreenPoint:aend];
&amp;nbsp;&amp;nbsp; 
 [EAGLContext setCurrentContext:context];
 glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
 
 // Convert locations from Points to Pixels
 CGFloat scale = self.contentScaleFactor;
 start.x *= scale;
 start.y *= scale;
 end.x *= scale;
 end.y *= scale;
 
 // Allocate vertex array buffer
 if(vertexBuffer == NULL)
&amp;nbsp; vertexBuffer = malloc(vertexMax * 2 * sizeof(GLfloat));
 
 // Add points to the buffer so there are drawing points every X pixels
 count = MAX(ceilf(sqrtf((end.x - start.x) * (end.x - start.x) + (end.y - start.y) * (end.y - start.y)) / kBrushPixelStep), 1);
 for(i = 0; i &amp;lt; count; ++i) {
&amp;nbsp; if(vertexCount == vertexMax) {
&amp;nbsp;&amp;nbsp; vertexMax = 2 * vertexMax;
&amp;nbsp;&amp;nbsp; vertexBuffer = realloc(vertexBuffer, vertexMax * 2 * sizeof(GLfloat));
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; vertexBuffer[2 * vertexCount + 0] = start.x + (end.x - start.x) * ((GLfloat)i / (GLfloat)count);
&amp;nbsp; vertexBuffer[2 * vertexCount + 1] = start.y + (end.y - start.y) * ((GLfloat)i / (GLfloat)count);
&amp;nbsp; vertexCount += 1;
 }
 
 // Render the vertex array
 glVertexPointer(2, GL_FLOAT, 0, vertexBuffer);
 glDrawArrays(GL_POINTS, 0, vertexCount);
 
 // Display the buffer
 glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
 [context presentRenderbuffer:GL_RENDERBUFFER_OES];
}

//Returns a map point based on user touch on screen.

-(AGSPoint*)getMapPointFromTouch:(NSSet *)touches
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch *myTouch = [[touches allObjects] objectAtIndex:0];
&amp;nbsp;&amp;nbsp;&amp;nbsp; CGPoint touchPoint = [myTouch locationInView:self];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *mapPoint = [_mapView toMapPoint:touchPoint];
&amp;nbsp;&amp;nbsp;&amp;nbsp; return mapPoint;
}

// Reads previously recorded points and draws them onscreen. This is the Shake Me message that appears when the application launches.
- (void) playback:(NSMutableArray*)recordedPaths
{
 NSData*&amp;nbsp;&amp;nbsp;&amp;nbsp; data = [recordedPaths objectAtIndex:0];
 AGSPoint*&amp;nbsp;&amp;nbsp; point = (AGSPoint*)[data bytes];
 NSUInteger&amp;nbsp;&amp;nbsp; count = [data length] / sizeof(CGPoint),
&amp;nbsp;&amp;nbsp;&amp;nbsp; i;
 
 // Render the current path
 for(i = 0; i &amp;lt; count - 1; ++i)//, ++point)
&amp;nbsp; [self renderLineFromPoint:[lines pointAtIndex:i] toPoint:[lines pointAtIndex:i+1]];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //[self renderLineFromPoint:*point toPoint:*(point + 1)];
 
 // Render the next path after a short delay 
 [recordedPaths removeObjectAtIndex:0];
 if([recordedPaths count])
&amp;nbsp; [self performSelector:@selector(playback:) withObject:recordedPaths afterDelay:0.0];
}

// Handles the start of a touch
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint* coord = [[event touchesForView:_mapView] anyObject];
 CGRect&amp;nbsp; bounds = [self bounds];
&amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch* touch = [[event touchesForView:self] anyObject];
 firstTouch = YES;
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // get touch point and store are current point
&amp;nbsp;&amp;nbsp;&amp;nbsp; currentPoint = [self getMapPointFromTouch:touches];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [lines addPoint: currentPoint];
}

// Handles the continuation of a touch.
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint* coord = [[event touchesForView:_mapView] anyObject];
 CGRect&amp;nbsp;&amp;nbsp;&amp;nbsp; bounds = [self bounds];
 UITouch*&amp;nbsp;&amp;nbsp; touch = [[event touchesForView:self] anyObject];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 // Convert touch point from UIView referential to OpenGL one (upside-down flip)
 if (firstTouch) {
&amp;nbsp; firstTouch = NO;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; previousPoint = [currentPoint copy];

 } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; previousPoint = [currentPoint copy];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentPoint = [self getMapPointFromTouch:touches];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [lines addPoint:currentPoint];
 }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 // Render the stroke
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self renderLineFromPoint:previousPoint toPoint:currentPoint];
}

// Handles the end of a touch event when the touch is a tap.
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
 CGRect&amp;nbsp;&amp;nbsp; bounds = [self bounds];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UITouch*&amp;nbsp;&amp;nbsp; touch = [[event touchesForView:self] anyObject];
 if (firstTouch) {
&amp;nbsp; firstTouch = NO;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; previousPoint = [currentPoint copy];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self renderLineFromPoint:previousPoint toPoint:currentPoint];
 }
}

// Handles the end of a touch event.
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
}

- (void)setBrushColorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue
{
 // Set the brush color using premultiplied alpha values
 glColor4f(100.0f,50.0f,200.0f,1.0f);
}

@end&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597151#M5191</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2021-12-12T01:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597152#M5192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, map view must be properly initialized. Are you showing open gl view on top of map view? If yes, you should create a custom initializer for the open gl view and pass already initialized mapView to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:04:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597152#M5192</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-16T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597153#M5193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes, my opengl view comes up ontop of my mapView. I thougt i was initialzing my mapview in my initWithCoder: method. how should i be initializing it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:22:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597153#M5193</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-16T18:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597154#M5194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you initializing open gl view with initWithCoder: method? If yes, you should create a custom init method as initWithCoder:mapView and pass already initialized mapView object from map view controller.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597154#M5194</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-16T18:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597155#M5195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;my painting classes are seperate from the view controller. i thought that this method should initialize my mapView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- (id)initWithCoder:(NSCoder*)coder mapView:(AGSMapView*) mapView graphicsLayer:(AGSGraphicsLayer*)graphicsLayer {&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 19:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597155#M5195</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-16T19:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597156#M5196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That'll just pass the object. If it is initialized then it'll work otherwise not. You should pass already initialized mapView object to that method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 20:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597156#M5196</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-16T20:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597157#M5197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i made this method in my paintingView class&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-(id) initWithPainter:(AGSMapView*)mapView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_mapView = mapView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and i call it in my view controller with this line in the viewDidLoad method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;self.paintingView = [[PaintingView alloc] initWithPainter:self.mapView];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in my initWithPainter method, the mapview is initialized, but not anywhere else that i use it. so in the getMapPointFromTouch method, the mapView is null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my original initWithCoder has bugs, and causes the app to crash.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 15:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597157#M5197</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-17T15:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597158#M5198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;in my initWithPainter method, the mapview is initialized, but not anywhere else that i use it. so in the getMapPointFromTouch method, the mapView is null.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because you are not retaining it. In your PaintingView create a *retain* property for mapView and access it by using self.mapView everywhere you are using it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 16:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597158#M5198</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-17T16:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597159#M5199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;still not working. in my paintingView hearder file&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@interface ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AGSMapView* _mapView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@property (nonatomic, retain) AGSMapView *mapView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the paintingView class&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@synthesize mapview= _mapview&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;initWithPainter: (AGSMapView*) mapView{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;self.mapView = mapView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;using self.mapview everwhere else in the paintingView class. in the get touchmethod, i print the mapView to nslog, and it shows null.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 16:25:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597159#M5199</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-17T16:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597160#M5200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;initWithPainter: (AGSMapView*) mapView{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NSLog(@"%@",mapView);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;self.mapView = mapView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NSLog(@"%@",self.mapView);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the result?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 16:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597160#M5200</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-17T16:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597161#M5201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;result is the same for both outputs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;AGSMapView: 0xa987e00; frame = (0 44; 1024, 704); clipsToBounds = YES; autoresize = RM+BM; autoresizeSubviews = NO; layer = &amp;lt;CALayer: 0x9aa0fe0&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 17:47:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597161#M5201</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-17T17:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597162#M5202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Then self.mapView in all places should give the same result in the same class unless you are explicitly releasing it or your class is getting dealloc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other places you are trying to access it as _mapView or self.mapView?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 18:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597162#M5202</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-17T18:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597163#M5203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;accessing as self.mapView. i think my class might be getting dealloc'd somewhere, checking my code for this class right now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: dealloc is only in dealloc method&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-(void) dealloc{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if (brushTexture){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; glDeleteTextures(1, &amp;amp;brushTexture);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; brushTexture = 0; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if ([EAGLContext currentContext] == context)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [EAGLContext setCurrentContext:nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [context release];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; [super dealloc];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 18:09:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597163#M5203</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-17T18:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597164#M5204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You'll have to debug your code and find out where mapView is getting dealloc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 19:50:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597164#M5204</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2012-08-17T19:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597165#M5205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i figure out why it wasn't working. my uiview that is attached to the PaintingView class is initialized in the storyboard, and is never sent the mapview.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so when i create the object out of this line of code, the mapview is only existing in that object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;self.paintingView = [[PaintingView alloc] initWithPainter:self.mapView];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is there any alternate way to do this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2012 17:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597165#M5205</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-21T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting ags point from opengl</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597166#M5206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;solved this by making my painting class have a delegate method, and adding the delegate as a protocol into my main view controller.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the delegate method gets the mapview from the main view controller.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 16:52:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-ags-point-from-opengl/m-p/597166#M5206</guid>
      <dc:creator>HamzaHaroon</dc:creator>
      <dc:date>2012-08-22T16:52:16Z</dc:date>
    </item>
  </channel>
</rss>

