AnsweredAssumed Answered

Projecting image on map

Question asked by purpledunes on May 12, 2014
Latest reply on May 12, 2014 by purpledunes
I have an image which I would like to project on a map at a certain coordinate, scale and rotation. For example the image might by 1000 by 1000 pixels and represent an area the size of 0.01x0.05 decimal degrees, oriented north to keep things simple. It's transparant so I want to see the base map below it.

I tried using a AGSPictureMarkerSymbol but it displays the image with a fixed number of pixels, regardless of zoom level. So it would look as big as the earth or as small as a house, rather than a fixed 0.01x0.05 decimal degrees.

    AGSPictureMarkerSymbol *symbol = [AGSPictureMarkerSymbol pictureMarkerSymbolWithImageNamed:@"SomeObject"];      double lat =  55.0;     double lon = 5.0          AGSMutablePolygon *area = [[AGSMutablePolygon alloc] initWithSpatialReference:[AGSSpatialReference wgs84SpatialReference] ];     [area addRingToPolygon];     [area addPointToRing:[AGSPoint pointWithX:lon y:lat spatialReference:nil]];     [area addPointToRing:[AGSPoint pointWithX:lon + 0.01 y:lat spatialReference:nil]];     [area addPointToRing:[AGSPoint pointWithX:lon+0.01 y:lat + 0.005 spatialReference:nil]];     [area addPointToRing:[AGSPoint pointWithX:lon y:lat + 0.005 spatialReference:nil]];     [area closePolygon];          AGSPoint *webMercatorArea = (AGSPoint *)[[AGSGeometryEngine defaultGeometryEngine] projectGeometry:area toSpatialReference:[AGSSpatialReference webMercatorSpatialReference]];      AGSGraphic *previewGraphic = [AGSGraphic graphicWithGeometry:webMercatorArea symbol:symbol attributes:nil];        [self.documentGraphicsLayer addGraphic:graphic];

I also tried using AGSPictureFillSymbol. This at least prevents the image from drawing outside the specified area on the map, but the scale is still wrong.

AGSPictureFillSymbol *symbol = [AGSPictureFillSymbol pictureFillSymbolWithImageNamed:@"SomeObject"];

I'm probably using the wrong approach here.