The custom dynamic layer sample is available on github.You should use AGSImageRequestOperation to request an image from requestImageWithWidth method.Regards,Nimesh
Great! Glad to know that everything is working for you now! 🙂Regards,Nimesh
heatArea = self.mapView.visibleArea;
AGSSpatialReference *baseSR = [AGSSpatialReference spatialReferenceWithWKID:102100]; AGSGeometryEngine *geometryEngine = [AGSGeometryEngine defaultGeometryEngine]; AGSPoint *min = [[AGSPoint alloc] initWithX:heatArea.envelope.xmin y:heatArea.envelope.ymin spatialReference:heatArea.envelope.spatialReference]; AGSPoint *adjustedMin = (AGSPoint*) [geometryEngine projectGeometry:min toSpatialReference:baseSR]; AGSPoint *max = [[AGSPoint alloc] initWithX:heatArea.envelope.xmax y:heatArea.envelope.ymax spatialReference:heatArea.envelope.spatialReference]; AGSPoint *adjustedMax = (AGSPoint*) [geometryEngine projectGeometry:max toSpatialReference:baseSR]; densityFullEnvelope = [AGSEnvelope envelopeWithXmin:adjustedMin.x ymin:adjustedMin.y xmax:adjustedMax.x ymax:adjustedMax.y spatialReference:baseSR];
- (NSOperation<AGSDynamicLayerDrawingOperation>*)exportMapImage:(AGSExportImageParams*)params { DensityMapOperation *operation = [[DensityMapOperation alloc] initWithParams:params]; [self.exportDelegate dynamicLayer:self exportMapImageOperation:operation didFinishWithImage:self.mapImage]; return operation; } - (AGSUnits)units { return densityUnits; } - (AGSSpatialReference *)spatialReference { return densityFullEnvelope.spatialReference; } - (AGSEnvelope *)fullEnvelope { return densityFullEnvelope; } - (AGSEnvelope *)initialEnvelope { //Assuming our initial extent is the same as the full extent return densityFullEnvelope; }
- (AGSExportImageParams *)exportImageParams { return theParams; }
[self.exportDelegate dynamicLayer:self exportMapImageOperation:operation didFinishWithImage:self.mapImage];
DensityMapLayer *densityMapLayer = [[DensityMapLayer alloc] initWithGeometry:heatArea]; densityMapLayer.mapImage = [heatServer.mapImage copy]; UIView *densityView = [self.mapView addMapLayer:densityMapLayer withName:@Density Layer];
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.