map.addLayers();

985
4
Jump to solution
05-07-2013 12:37 AM
MatejSkerjanc
Occasional Contributor
Hello,
when i'm adding arcgislocaltiledlayer what should i do to refresh the map.
My map won't refresh itself, is there any certain procedure i should be following to update the map?

Regards,
Matej
0 Kudos
1 Solution

Accepted Solutions
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
You might need to call initLayer() in order to initialize the layer.  This should refresh the map.

View solution in original post

0 Kudos
4 Replies
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
You might need to call initLayer() in order to initialize the layer.  This should refresh the map.
0 Kudos
MatejSkerjanc
Occasional Contributor
Andrew
my arcgislocaltiledlayer didnt have the method initLayer but you can pass it as a parameter when creating it.
Thanks you've solved it!


Regards,
Matej


p.s. http://developers.arcgis.com/en/android/api-reference/reference/com/esri/android/map/TiledLayer.html
it describes some abstract method initLayer
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
My bad.  I was referring to this page of the API Doc:
http://developers.arcgis.com/en/android/api-reference/reference/com/esri/android/map/ags/ArcGISLocal...

here is a method "initLayer();" but It's protected.  I missed that.  You are correct, initializing the layer at creation via parameter is the better way to do it.  Sorry about the confusion, but I'm glad you figured it out.
0 Kudos
JessicaSena
New Contributor
Hi,

one question about this solution. When you talk about the init parameter when you create the layer, I guess you're talking about doing something like that:

new ArcGISLocalTiledLayer("file://"+path, true);

And then adding this new Layer to the Map, should work and the map should be refreshed, right? but in my case this is not working neither and the map is not showing anything.

Myabe I'm not doing the creation and the adding in the right place, could you point me when yo do that in order to work? (I'm having some problems when I add the layers outside the OnCreate method... maybe that's the problem here too?)

Thanks,
0 Kudos