Beispiel #1
0
 public void viewMarkers() throws JSONException {
   JSONArray jsonArray;
   jsonArray = new JSONArray(MarkerFile.getMarkersData());
   for (int i = 0; i < jsonArray.length(); i++) {
     JSONObject jsonObj = jsonArray.getJSONObject(i);
     mMap.addMarker(
         new MarkerOptions()
             .title(jsonObj.getString("name"))
             .snippet(jsonObj.getJSONObject("content").toString())
             .position(
                 new LatLng(
                     jsonObj.getJSONArray("latlng").getDouble(0),
                     jsonObj.getJSONArray("latlng").getDouble(1))));
   }
 }