How convert the code of the google maps api v1 to v2? -


how can on google maps api v2?

    mapview mv = (mapview) findviewbyid(r.id.mvgoogle);     mv.setbuiltinzoomcontrols(true);     mapcontroller mc = mv.getcontroller();     arraylist all_geo_points = getdirections(17.3849, 78.4866, 28.63491, 77.22461);     geopoint moveto = all_geo_points.get(0);     mc.animateto(moveto);     mc.setzoom(12);     mv.getoverlays().add(new myoverlay(all_geo_points)); 

use fragmentactivity , in oncreate() method:

googlemap mmap =((supportmapfragment)getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap();  arraylist <latlng> all_geo_points  = new arraylist<latlng>();  all_geo_points.add(new latlng(17.3849, 78.4866));  all_geo_points.add(new latlng(28.63491, 77.22461));  latlng moveto = all_geo_points.get(0);  cameraposition cameraposition = new cameraposition.builder().target(moveto).zoom(12).build();  mmap.animatecamera(cameraupdatefactory.newcameraposition(cameraposition)); 

check map v2 demo.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -