Esempio n. 1
0
  private void setUpMap() {
    mMap.setOnMarkerClickListener(
        new GoogleMap.OnMarkerClickListener() {
          @Override
          public boolean onMarkerClick(Marker marker) {
            //              Log.e(tag, "clicked on marker");
            String eventId = marker.getSnippet();
            setEvent(eventId);
            refreshIfNeeded();
            return false;
          }
        });

    mMap.setMapType(Settings.getMapType());

    computeMarkerColors();

    showEvents();

    selEventId = ((MapActivityInterface) getActivity()).getEventId();
    if (selEventId != null) {
      Log.e(tag, "Setting up initial event");
      setEvent(selEventId);
      Event e = MainModel.getEvent(selEventId);
      mMap.animateCamera(
          CameraUpdateFactory.newLatLngZoom(new LatLng(e.getLat(), e.getLng()), 12.0f));
    }
    //        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude,
    //              longitude), 12.0f));
  }
Esempio n. 2
0
 private void refreshIfNeeded() {
   Log.e(tag, "refreshing");
   if (MainModel.isChanged()) {
     clearFamilyStoryLines();
     clearLifeStory();
     clearSpouseLine();
     mMap.clear();
     mMap.setMapType(Settings.getMapType());
     showEvents();
   }
   MainModel.setChanged(false);
 }