Esempio n. 1
0
  /**
   * Places a marker on the map.
   *
   * @param markable the markable object
   */
  public Marker addMarkable(Markable markable) {
    MarkerOptions opt = new MarkerOptions();
    markable.mark(opt); // Allow object to adjust marker

    Log.v(
        TAG,
        String.format("Adding marker: pos = %s, title = %s", opt.getPosition(), opt.getTitle()));
    return gmap.addMarker(opt);
  }
Esempio n. 2
0
 @Override
 protected void onPostExecute(ArrayList<MarkerOptions> result) {
   ArrayList<Integer> paradasAgregadas = new ArrayList<Integer>();
   if (getMap() != null) {
     getMap().clear();
     dibujarDistancia();
   }
   for (MarkerOptions mo : result) {
     synchronized (DataStorage.paradas) {
       Parada p = DataStorage.paradas.get(Integer.parseInt(mo.getTitle()));
       if (p.getRepetida() != null) {
         if (paradasAgregadas.contains(p.getRepetida().getId())) {
           continue;
         }
       }
       paradasAgregadas.add(Integer.parseInt(mo.getTitle()));
       if (getMap() != null) {
         getMap().addMarker(mo);
       }
     }
   }
   super.onPostExecute(result);
 }
  public void updatemarkers() {
    Log.e("SERVHASH", "UPDATING MARKERS");
    for (String uid : new_markers.keySet()) {
      Log.e("Markers", "UID:" + uid);
      if (!uid.equals(UID)) {
        LinkedList ud = new_markers.get(uid);
        LatLng pos = new LatLng((double) ud.get(2), (double) ud.get(3));
        MarkerOptions m =
            new MarkerOptions()
                .title((String) ud.get(0))
                .position(pos)
                .icon(markcol[getColid((String) ud.get(1))]);
        Log.e("Markers", "Created new options");

        if (m == null) Log.d("Markers", "Null Marker");
        else
          Log.d(
              "Markers",
              "Title:"
                  + m.getTitle()
                  + ";Lat:"
                  + m.getPosition().latitude
                  + ";Long:"
                  + m.getPosition().longitude);

        if (cur_markers.containsKey(uid)) {
          Log.d("Markers", "Already Here.So update marker");
          cur_markers.get(uid).setPosition(pos);
        } else {
          Log.d("Markers", "Adding new Marker");

          Marker nm = mMap.addMarker(new MarkerOptions().title((String) ud.get(0)).position(pos));
          cur_markers.put(uid, nm);
        }
      } else {
        Log.e("Markers", "Thats me");
      }
    }
    for (String uid : cur_markers.keySet()) {
      if (!new_markers.containsKey(uid)) {
        cur_markers.get(uid).remove();
        cur_markers.remove(uid);
      }
    }
  }
Esempio n. 4
0
 static void a(MarkerOptions var0, Parcel var1, int var2) {
   int var3 = com.google.android.gms.common.internal.safeparcel.b.H(var1);
   com.google.android.gms.common.internal.safeparcel.b.c(var1, 1, var0.getVersionCode());
   com.google.android.gms.common.internal.safeparcel.b.a(
       var1, 2, (Parcelable) var0.getPosition(), var2, false);
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 3, (String) var0.getTitle(), false);
   com.google.android.gms.common.internal.safeparcel.b.a(
       var1, 4, (String) var0.getSnippet(), false);
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 5, (IBinder) var0.oe(), false);
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 6, var0.getAnchorU());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 7, var0.getAnchorV());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 8, var0.isDraggable());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 9, var0.isVisible());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 10, var0.isFlat());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 11, var0.getRotation());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 12, var0.getInfoWindowAnchorU());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 13, var0.getInfoWindowAnchorV());
   com.google.android.gms.common.internal.safeparcel.b.a(var1, 14, var0.getAlpha());
   com.google.android.gms.common.internal.safeparcel.b.H(var1, var3);
 }