Select to view content in your preferred language

when I  setTileDelegate   baseman can not to display

805
5
Jump to solution
07-23-2012 08:32 PM
niuruigang
Emerging Contributor
i want to get  tile  by operationDidGetTile methods in AGSTiledLayerTileDelegate, but when operationDidGetTile was called,basemap can not display on AGSMapView. the sample code is below:
        //.h file
        @interface DBViewController : UIViewController<AGSTiledLayerTileDelegate,...

        //.m file
        AGSTiledMapServiceLayer *tiledLayer = [[AGSTiledMapServiceLayer alloc] initWithURL:[NSURL URLWithString:layerUrl]];
        UIView<AGSLayerView>* lyr = [self.BaseMapView addMapLayer:tiledLayer withName:BASEMAPLAYER_NAME];
        [tiledLayer setTileDelegate:self];
        lyr.drawDuringPanning = YES;

       #pragma mark - AGSTiledLayerTileDelegate
       - (void)tiledLayer:(AGSTiledLayer *) layer operationDidGetTile:(NSOperation *) op
       {
            return;
       }
i can not find any bug in source code, I'll be much appreciated  any point from anyone!
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
Okay..so you're looking for offline tiled layer. You should use AGSLocalTiledLayer instead of AGSTiledMapServiceLayer. Please see conceptual documentation and sample.

Regards,
Nimesh

View solution in original post

0 Kudos
5 Replies
NimeshJarecha
Esri Regular Contributor
You are not suppose to set the tileDelegate. Here is the API reference doc of this property. The UIView<AGSLayerView>* lyr in your code becomes the tileDelegate by default, which you are not suppose to replace. Hence, you are not seeing the map.

- (id<AGSTiledLayerTileDelegate>) tileDelegate [read, write, assign]
Delegate to be notified when a tile is retrieved asynchronously. When this layer is loaded, a corresponding View object is automatically set as the tileDelegate which should not be replaced.


Hope this helps!

Regards,
Nimesh
0 Kudos
niuruigang
Emerging Contributor
You are not suppose to set the tileDelegate. Here is the API reference doc of this property. The UIView<AGSLayerView>* lyr in your code becomes the tileDelegate by default, which you are not suppose to replace. Hence, you are not seeing the map.



Hope this helps!

Regards,
Nimesh


Thanks for your response, it's much appreciated. but I also want to ask again�?if I want get tiles when displaying base map,how can I do? or when displaying base map, I can't get tiles by the flow delegate method?
      - (void)tiledLayer:(AGSTiledLayer *) layer operationDidGetTile:(NSOperation *) op
0 Kudos
NimeshJarecha
Esri Regular Contributor
I would like to know why you want to listen to operationDidGetTile method? What is the intention? What you want to do with it?

Regards,
Nimesh
0 Kudos
niuruigang
Emerging Contributor
I would like to know why you want to listen to operationDidGetTile method? What is the intention? What you want to do with it?

Regards,
Nimesh


Thanks Mr Nimesh! I want to develop a app that can automatically save tile images from base map layer to a Sqlite database, when the net was disconnected I can browse the map get from database. As a app(C#) specified by the flow URL:
      http://www.arcgis.com/home/item.html?id=d2b40d7f553947a2b575556b057f5dcf


Best Regards,
Niuruigang
0 Kudos
NimeshJarecha
Esri Regular Contributor
Okay..so you're looking for offline tiled layer. You should use AGSLocalTiledLayer instead of AGSTiledMapServiceLayer. Please see conceptual documentation and sample.

Regards,
Nimesh
0 Kudos