Select to view content in your preferred language

Custom layer

1447
5
06-04-2013 08:46 PM
MajBro
by
Emerging Contributor
Hi,

    I'm developing map iOS app using Arcgis sdk. I googled around with no luck. What I have is tile server which have to call by get method    

Host:
    https://servername?api=tile

and parameter like:
    "x=%@&y=%@&z=%@", x, y, z

to get tile image. and output of api is rawdata of tile image (NSData) what should I do for using Arcgis.

PS. The way I use with MapKit is like this:
    [self.map addOverlay:tileOverlay];
but ArcGIS has no overlay? just only addMapLayer? so I google and found keyword like custom layer.

What I have
API URL for get tile.

What I need to do.
1. Create custom layer
2. Get x, y, z to send to api for geting tile.

What server return
An encrypt image rawdata. So I need to decrypt it before using.

Can someone help me out please.

Thanks in advance.


EDIT:
I found this post
http://forums.arcgis.com/threads/60285-How-do-I-create-a-layer-that-is-generated-from-an-image

my case just kind of this. But I cannot follow what in this post wrote.

EDIT2:
For more information I found this post
in this link -> http://forums.arcgis.com/threads/38835-custom-tiled-layer-sample-has-nsgenericexception

thanks Nimesh,

AGS api version 2.0,
ios 4.3



images from web:

NSString* dir = [_allLayersPath stringByAppendingFormat:@"/%@/%@/%@.png",decLevel,hexRow,hexCol];
//NSLog(dir);
_tile.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:dir]]];

it works well until the exception happen.

I just want sth. like this, ARCGIS 10.1 is still allow sth. like this?
0 Kudos
5 Replies
DiveshGoyal
Esri Regular Contributor
You're on the right track - you need to create a custom layer to display your maps.
You have 2 choices - you can create a custom dynamic layer (if the image your server provides covers the map's entire viewable extent) or you can create a custom tiled layer (if the image your server provides covers only a portion of the viewable extent, and you need to potentially request multiple tiles for a given extent).

Refer to http://developers.arcgis.com/en/ios/api-reference/category_a_g_s_layer_07_for_subclass_eyes_only_08....
for more information on how to create custom layers.

You can also refer to thee sample showing how to create a custom tiled layer.
http://www.arcgis.com/home/item.html?id=faab53d140e44c02941bf7deb30d7d18
0 Kudos
MajBro
by
Emerging Contributor
Thank you for your reply and sorry for late reply. Actually, I looked at this sample but don't understand how to use. (Sorry, I totally new to ArcGIS).

In sample, project use row and column but my API using x,y coordinate system.
I try to study ROW and COL system to convert to X,Y (Is this possible?).
And what about tileKey? What is it?

Any more information would be appreciate.

Thanks you.

EDIT:
In sample code there is requestTileForKey: delegate method, What this method get called by?

EDIT2:
Now I know that level, row, column is z, x, y .But how can I get these value?

EDIT3:
In sample code there is XML Parser bundle. Is this needed? Look like app max zoom level is up to AGSLOD, I need to define this lod?

EDIT4:
I need to inherit from AGSDynamicLayer instead of AGSTiledServiceLayer. Because I have base map and tile I need is not basemap. So, now it's not look like a sample code.
0 Kudos
MajBro
by
Emerging Contributor
OK, I get your idea. Please give me some custom dynamic layer example for ArcGIS API v10.1.

http://www.arcgis.com/home/item.html...1bf7deb30d7d18
This example is implement from AGSTiledServiceLayer,
I need example in AGSDynamicLayer.

Thank you.
0 Kudos
MajBro
by
Emerging Contributor
I asked quest a week ago. Please response.
0 Kudos
NimeshJarecha
Esri Regular Contributor
You can subclass AGSDynamicLayer to create a custom dynamic layer. Look at AGSDynamicLayer(ForSubclassEyesOnly) .

Regards,
Nimesh
0 Kudos