PDA

View Full Version : Android : unable to set multiple maps



gabrjela
07.04.2015, 13:28
I need two SKMapSurfaceView instances, in separate screens - so I've followed doc for SKMapSurfaceView.preserveGLContext :
Default value is true. If multiple map instances need to be supported then this has to be set to false before setContentView is called for the layout containing the first map . This can be done once when starting the application.
but it doesn't seem to work, i don't see onSurfaceCreated() callback for 2nd map.
Did anyone manage to create two maps?

Thx.

Adela_Silvia
07.04.2015, 16:46
Hello,

Can you attempt to reproduce your problem in our demo app so that we can properly investigate it? or could you please send us your demo project at dev@skobbler.com?

gabrjela
08.04.2015, 11:36
Hi Adela,

Just completed the demo prj with my scenario (second map added), and realized there's no problem in displaying second map in demo prj. Of course that I've started to look for what I've done differently comparing to my prj, and
found what I did wrong - I was obtaining SKMapSurfaceView object not in onCreate method, but in a btn onClick method. After moving these lines
SKMapViewHolder mapViewGroup = (SKMapViewHolder) findViewById(R.id.map);
mapView = mapViewGroup.getMapSurfaceView();
in onCreate() everything went well.

Thank you for your support.

Adela_Silvia
08.04.2015, 14:20
Glad to hear you managed to make it work