@Override
  public void onMapClick(LatLng point) {
    // mTapTextView.setText("tapped, point=" + point);

    int max = markers.size();

    // clear all markers
    for (int j = 0; j < max; j++) {

      marker = markers.get(j);
      marker.setVisible(false);
    }

    for (int i = 0; i < max; i++) {

      polygon = polygons.get(i);

      polygonPath = polygon.getPoints();

      if (PolyUtil.containsLocation(point, polygonPath, false)) {

        // when click change polygon color
        polygon.setFillColor(randomColor());
        marker = markers.get(i);
        marker.setVisible(true);
        marker.showInfoWindow();

        break;
      } // if
    } // for
  }
Ejemplo n.º 2
0
 public void run() {
   if (mCurrentFocusVehicleMarker != null
       && mCurrentFocusVehicleMarker.isInfoWindowShown()) {
     // Force an update of the marker balloon, so "last updated" time ticks up
     mCurrentFocusVehicleMarker.showInfoWindow();
   }
 }
Ejemplo n.º 3
0
  private void showObservationCallout(com.google.android.gms.maps.model.Marker marker) {
    final Marker item = mMarkersAdapter.getItem(marker);
    Bundle args = new Bundle();
    args.putString("uid", item.uid);
    getLoaderManager()
        .restartLoader(
            LOADER_OBSERVATION,
            args,
            new LoaderManager.LoaderCallbacks<Observation>() {

              @Override
              public Loader<Observation> onCreateLoader(int id, Bundle args) {
                return new ObservationLoader(getActivity(), args.getString("uid"));
              }

              @Override
              public void onLoadFinished(Loader<Observation> loader, Observation data) {
                if (data != null) {
                  com.google.android.gms.maps.model.Marker marker = mMarkersAdapter.getMarker(item);
                  if (marker != null) {
                    mMarkersAdapter.getItem(marker).observation = data;
                    if (marker.isInfoWindowShown()) marker.showInfoWindow();
                  }
                }
              }

              @Override
              public void onLoaderReset(Loader<Observation> loader) {}
            });
    marker.showInfoWindow();
    mInfoWindowMarker = marker;
    AnalyticsHelper.trackUiEvent("callout", null);
  }
Ejemplo n.º 4
0
  /** Displays current location with information about timezone etc. */
  private void displayCurrentLocation() {
    final double[] loc = getLocation();
    if (loc == null) {
      Toast.makeText(this, "Could not fetch location", Toast.LENGTH_LONG).show();
      return;
    }

    final View infoWindow = LayoutInflater.from(this).inflate(R.layout.infowindow, null);

    mMap.setInfoWindowAdapter(
        new GoogleMap.InfoWindowAdapter() {
          @Override
          public View getInfoWindow(Marker marker) {
            return null;
          }

          @Override
          public View getInfoContents(Marker marker) {
            populateInfoWindow(loc, infoWindow);
            return infoWindow;
          }
        });

    Marker me =
        mMap.addMarker(
            new MarkerOptions()
                .position(new LatLng(loc[0], loc[1]))
                .title("Current Location")
                .icon(BitmapDescriptorFactory.fromResource(android.R.drawable.star_on)));

    mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(loc[0], loc[1]), 5));
    me.showInfoWindow();
  }
  public static Marker placeRobotMarkerOnMap(
      Marker marker,
      GoogleMap mMap,
      LatLng location,
      boolean animateTheCamera,
      Resources res,
      Context context) {
    try {
      marker.remove();
    } catch (Exception e) {
      e.printStackTrace();
      Log.e("MapUtilities", "placeMarkerOnMapUserLatLng: Could not remove Robots Marker");
    }
    MarkerOptions m =
        new MarkerOptions()
            .position(location)
            .icon(BitmapDescriptorFactory.fromResource(R.drawable.robot))
            .title("ROBOT");
    marker = mMap.addMarker(m);
    marker.showInfoWindow();
    if (animateTheCamera) animateCameraLatLng(mMap, location, res);

    Log.d("ROBOT_LOCATION", "Latitude: " + location.latitude + " Longitude: " + location.longitude);
    // Toast.makeText(context,"Latitude: " +location.latitude+" Longitude:
    // "+location.longitude,Toast.LENGTH_LONG).show();
    return marker;
  }
  private void setUpMap() {
    verifyLocationPermission();

    mMap.setOnMapClickListener(this);
    mMap.setOnInfoWindowClickListener(this);

    UiSettings settings = mMap.getUiSettings();
    settings.setAllGesturesEnabled(true);
    settings.setMapToolbarEnabled(false);

    // Use stops location if present, otherwise set a geo point in
    // central Stockholm.
    LatLng latLng;
    int zoom;
    if (mStop.getLocation() != null) {
      latLng = new LatLng(mStop.getLocation().getLatitude(), mStop.getLocation().getLongitude());
      zoom = 16;
    } else {
      latLng = new LatLng(59.325309, 18.069763);
      zoom = 12;
    }

    mMarker =
        mMap.addMarker(
            new MarkerOptions()
                .position(latLng)
                .title(getString(R.string.tap_to_select_this_point))
                .visible(true)
                .draggable(true)
                .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));
    mMarker.showInfoWindow();

    mMap.moveCamera(
        CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(latLng, zoom)));
  }
 @Override
 public void showInfoWindow() {
   if (virtual == null && markers.size() > 1) {
     refresh();
   }
   if (virtual != null) {
     virtual.showInfoWindow();
   }
 }
  private void showMarkerInfo(Marker marker) {

    marker.showInfoWindow();

    if (mGoogleMap.getCameraPosition().zoom < DEFAULT_ZOOM) {
      mGoogleMap.animateCamera(
          CameraUpdateFactory.newLatLngZoom(marker.getPosition(), DEFAULT_ZOOM));
    } else {
      mGoogleMap.animateCamera(CameraUpdateFactory.newLatLng(marker.getPosition()));
    }
  }
 // Display the alert that adds the marker
 private void showAlertDialogForPoint(final LatLng point) {
   BitmapDescriptor defaultMarker =
       BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED);
   // Extract content from alert dialog
   String title = m_trainer.getGym().getName();
   String snippet = m_trainer.getGym().getAddress().toString();
   // Creates and adds marker to the map
   Marker marker =
       m_map.addMarker(
           new MarkerOptions().position(point).title(title).snippet(snippet).icon(defaultMarker));
   marker.showInfoWindow();
 }
Ejemplo n.º 10
0
  @Override
  public boolean onMarkerClick(Marker arg0) {
    String userId = UsersManager.getInstance().getUserIdForMarkerId(arg0.getId());
    if (userId != null) {
      String name = UsersManager.getInstance().getUserNameForMarkerId(arg0.getId());
      String title = name + " meet me:";
      arg0.setTitle(title);
      arg0.showInfoWindow();
    }

    return true;
  }
  public void updateMarker(Airplane airplane) {
    for (Marker m : markers) {
      boolean infoShow = m.isInfoWindowShown();
      if (m.getTitle().equals(airplane.getHex())) {
        AirplanePosition position = airplane.getLastPosition();
        LatLng location = new LatLng(position.getLatitude(), position.getLongitude());
        float angle = (float) airplane.getHead() + map.getCameraPosition().bearing;
        m.setPosition(location);
        m.setIcon(BitmapDescriptorFactory.fromBitmap(getAirplaneIcon(angle)));

        if (infoShow) m.showInfoWindow();
        break;
      }
    }
  }
Ejemplo n.º 12
0
 @Override
 public void onMapLongClick(LatLng latlng) {
   // 既に追加マーカーを配置済みなら、前のマーカーを削除する
   if (mAddMarker != null) {
     mAddMarker.remove();
     mAddMarker = null;
   }
   // マーカーを追加し、インフォウィンドウを表示する
   MarkerOptions options = new MarkerOptions();
   options.position(latlng);
   BitmapDescriptor icon = BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE);
   options.icon(icon);
   options.title(getString(R.string.Marker_NotRegistered));
   mAddMarker = mMap.addMarker(options);
   mAddMarker.showInfoWindow();
 }
Ejemplo n.º 13
0
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    marker.setTitle(getIntent().getStringExtra("MarkerTitle"));

    marker.showInfoWindow();
    // refresh markers here
    // result code == 1 means that returned from MarkersInfo activity, data hasn`t changed
    // result code == 2 means that returned from MarkersInfo, data has changed
    // result code == 3 means that returned from EditActivity, but info not changed
    // result code == 4 means that returned from EditActivity, and data has changed
    if (data == null) {
      return;
    }
    if (resultCode == 1) {
      String name = data.getStringExtra("message"); // not used yet
    }
  }
Ejemplo n.º 14
0
    @Override
    protected void onPostExecute(Bitmap bitmapResult) {

      super.onPostExecute(bitmapResult);
      if (bitmapResult == null || cancelAsyncTasks || !isAdded() || map == null) {
        return;
      }
      Marker marker = markerMap.get(email);
      Boolean isNew = false;
      if (marker != null) {
        Log.d(TAG, "onPostExecute - updating marker: " + email);
        marker.setPosition(latLng);
        marker.setSnippet(time);
        marker.setIcon(BitmapDescriptorFactory.fromBitmap(bitmapResult));

      } else {
        Log.d(TAG, "onPostExecute - creating marker: " + email);
        marker =
            map.addMarker(
                new MarkerOptions()
                    .position(latLng)
                    .title(email)
                    .snippet(time)
                    .icon(BitmapDescriptorFactory.fromBitmap(bitmapResult)));
        Log.d(TAG, "onPostExecute - marker created");
        markerMap.put(email, marker);
        Log.d(TAG, "onPostExecute - marker in map stored. markerMap: " + markerMap.size());
        isNew = true;
      }

      if (marker.getTitle().equals(MainApplication.emailBeingTracked)) {
        marker.showInfoWindow();
        Log.d(TAG, "onPostExecute - showInfoWindow open");
        if (isNew) {
          map.moveCamera(CameraUpdateFactory.newLatLngZoom(marker.getPosition(), 16));
        } else {
          map.moveCamera(CameraUpdateFactory.newLatLng(marker.getPosition()));
        }
      } else if (firstTimeZoom
          && MainApplication.emailBeingTracked == null
          && MainApplication.userAccount != null
          && marker.getTitle().equals(MainApplication.userAccount)) {
        firstTimeZoom = false;
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(marker.getPosition(), 16));
      }
    }
    @Override
    public void onMapReady(GoogleMap googleMap) {

      mMap = googleMap;

      mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(StartLat, EndLng), 8.1f));

      // Instantiates a new Polyline object and adds points to define a rectangle

      Log.d("Start lat 1 ", String.valueOf(StartLat));
      Log.d("End lat 1 ", String.valueOf(EndLat));
      Log.d("Start lng 1 ", String.valueOf(StartLng));
      Log.d("End lng 1 ", String.valueOf(EndLng));

      PolylineOptions rectOptions =
          new PolylineOptions()
              .add(new LatLng(StartLat, StartLng))
              .add(new LatLng(EndLat, EndLng))
              .color(R.color.primaryColor)
              .width(6); // North of the previous point, but at the same longitude
      // Closes the polyline.

      mMap.getUiSettings().setMapToolbarEnabled(false);
      mMap.getUiSettings().setZoomControlsEnabled(true);
      mMap.getUiSettings().setZoomGesturesEnabled(true);

      // Get back the mutable Polyline
      Polyline polyline = mMap.addPolyline(rectOptions);

      final Marker markerZero =
          mMap.addMarker(
              new MarkerOptions()
                  .position(new LatLng(StartLat, StartLng))
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.pindriver))
                  .snippet(FromRegionEnName_Str)
                  .title(FromEmirateEnName_Str));

      mMap.addMarker(
          new MarkerOptions()
              .position(new LatLng(EndLat, EndLng))
              .icon(BitmapDescriptorFactory.fromResource(R.drawable.pindriver))
              .snippet(ToRegionEnName_Str)
              .title(ToEmirateEnName_Str));
      markerZero.showInfoWindow();
    }
 @Override
 public void onMyLocationChange(Location location) {
   if (myposition == null) {
     MarkerOptions markerOptions = new MarkerOptions();
     markerOptions.position(new LatLng(location.getLatitude(), location.getLongitude()));
     markerOptions.title("Yo");
     myposition = map.addMarker(markerOptions);
     CameraPosition cameraPosition =
         new CameraPosition.Builder()
             .target(new LatLng(location.getLatitude(), location.getLongitude()))
             .zoom(15)
             .build();
     map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
     myposition.showInfoWindow();
   } else {
     myposition.setPosition(new LatLng(location.getLatitude(), location.getLongitude()));
   }
 }
Ejemplo n.º 17
0
  private void setUpMap() {
    wmsTileProvider = TileProviderFactory.getOsgeoWmsTileProvider();
    wmsTileOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(wmsTileProvider));
    wmsTileOverlay.setVisible(false);

    // Because the demo WMS layer we are using is just a white background map, switch the base layer
    // to satellite so we can see the WMS overlay.
    // mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
    mMap.setMapType(GoogleMap.MAP_TYPE_NONE);

    // LatLng latLng = new LatLng(28.0886, -16.2762);
    LatLng latLng = new LatLng(Double.parseDouble(y), Double.parseDouble(x));
    Marker mMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(name));
    mMarker.showInfoWindow();

    CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 15);
    mMap.animateCamera(cameraUpdate, 2000, null);
  }
Ejemplo n.º 18
0
  @Override
  public void onMapReady(GoogleMap googleMap) {

    googleMap.setMyLocationEnabled(true);
    googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(37.35, -122.1), 7));
    Marker marker =
        googleMap.addMarker(
            new MarkerOptions()
                .position(new LatLng(37.35, -122.1))
                .title("Circle")
                .snippet("This snippet describes about simple Circle with Radius "));
    marker.showInfoWindow();
    // Instantiates a new CircleOptions object and defines the center and radius
    CircleOptions circleOptions =
        new CircleOptions().center(new LatLng(37.4, -122.1)).radius(100000); // In meters

    // Get back the mutable Circle
    Circle circle = googleMap.addCircle(circleOptions);
  }
Ejemplo n.º 19
0
 /**
  * Update an existing marker on the map with the current vehicle status
  *
  * @param m Marker to update
  * @param l Location to add the marker at
  * @param isRealtime true if the marker shown indicate real-time info, false if it should
  *     indicate schedule
  * @param status real-time status of the vehicle
  * @param response response containing the provided status
  */
 private void updateMarker(
     Marker m,
     Location l,
     boolean isRealtime,
     ObaTripStatus status,
     ObaTripsForRouteResponse response) {
   boolean showInfo = m.isInfoWindowShown();
   m.setIcon(getVehicleIcon(isRealtime, status, response));
   // Update Hashmap with newest status - needed to show info when tapping on marker
   mVehicles.put(m, status);
   // Update vehicle position
   Location markerLoc = MapHelpV2.makeLocation(m.getPosition());
   // If its a small distance, animate the movement
   if (l.distanceTo(markerLoc) < MAX_VEHICLE_ANIMATION_DISTANCE) {
     AnimationUtil.animateMarkerTo(m, MapHelpV2.makeLatLng(l));
   } else {
     // Just snap the marker to the new location - large animations look weird
     m.setPosition(MapHelpV2.makeLatLng(l));
   }
   // If the info window was shown, make sure its open (changing the icon could have closed it)
   if (showInfo) {
     m.showInfoWindow();
   }
 }
 @ReactProp(name = PROP_CLICK_MARKER)
 public void setPropClickMarker(MapView view, @Nullable Integer clickMarker) {
   WritableMap properties = getProperties();
   String key = String.valueOf(clickMarker);
   if (clickMarker == null) {
     if (properties.hasKey(PROP_CLICK_MARKER)) {
       if (markerLookup.containsKey(String.valueOf(properties.getInt(PROP_CLICK_MARKER)))) {
         Marker marker =
             mapMarkers.get(
                 Integer.parseInt(
                     markerLookup.get(String.valueOf(properties.getInt(PROP_CLICK_MARKER)))));
         marker.hideInfoWindow();
         Log.i(REACT_CLASS, "hideInfoWindow");
       }
     }
   } else {
     properties.putInt(PROP_CLICK_MARKER, clickMarker);
     if (markerLookup.containsKey(key)) {
       Marker marker = mapMarkers.get(Integer.parseInt(markerLookup.get(key)));
       marker.showInfoWindow();
       Log.i(REACT_CLASS, "showInfoWindow" + String.valueOf(marker));
     }
   }
 }
Ejemplo n.º 21
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.maps_activity);

    getShaKey();
    googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.the_map)).getMap();

    Spinner spinner = (Spinner) findViewById(R.id.mapList);
    ArrayAdapter<CharSequence> adapter =
        ArrayAdapter.createFromResource(
            this, R.array.mapOptions, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(this);

    googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
    Marker TP =
        googleMap.addMarker(
            new MarkerOptions()
                .position(base)
                .title("Glen Rouge Campground")
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));
    try {
      MapsInitializer.initialize(this);
      LatLng blackDog = new LatLng(43.797896, -79.139111);
      BD =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(blackDog)
                  .title("The Black Dog Pub")
                  .snippet("http://blackdogpub.tv/"));

      LatLng wimpys = new LatLng(43.797234, -79.149837);
      WD =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(wimpys)
                  .title("Wimpys Diner")
                  .snippet("http://wimpysdiner.ca/"));

      LatLng muchoBurrito = new LatLng(43.797538, -79.149169);
      MB =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(muchoBurrito)
                  .title("Mucho Burrito ")
                  .snippet("http://muchoburrito.ca/"));

      LatLng mcd = new LatLng(43.800225, -79.143521);
      MC =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(mcd)
                  .title("McDonalds")
                  .snippet("http://www.mcdonalds.ca/ca/en.html"));

      // grocery
      LatLng noFrills = new LatLng(43.798149, -79.141233);
      NF =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(noFrills)
                  .title("No Frills")
                  .snippet(
                      "http://www.nofrills.ca/LCLOnline/store_selector_map.jsp?_requestid=275626"));
      NF.showInfoWindow();
      LatLng metro = new LatLng(43.788651, -79.139576);
      M =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(metro)
                  .title("Metro")
                  .snippet("http://www.metro.ca/home.en.html"));
      M.showInfoWindow();
      LatLng freshCo = new LatLng(43.818446, -79.118172);
      FC =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(freshCo)
                  .title("FreshCo")
                  .snippet("http://www.freshco.com/Home.aspx"));
      FC.showInfoWindow();
      LatLng rougeB = new LatLng(43.793557, -79.117920);
      RB =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(rougeB)
                  .title("Rouge Beach")
                  .snippet("http://www.rougepark.com/explore/interest/rouge_beach.php"));

      LatLng liverB = new LatLng(43.811955, -79.076850);
      LP =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(liverB)
                  .title("Liverpool Beach")
                  .snippet(
                      "http://www.pickering.ca/en/discovering/beachfrontparkmillenniumsquare.asp"));

      LatLng beachB = new LatLng(43.812543, -79.090883);
      BP =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(beachB)
                  .title("Beachpoint Beach")
                  .snippet(
                      "http://www.pickering.ca/en/discovering/rotaryfrenchmansbaywestpark.asp"));

      LatLng canT = new LatLng(43.797228, -79.154135);
      CTS =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(canT)
                  .title("Canadian Tire")
                  .snippet("http://www.canadiantire.ca/en.html"));

      LatLng homeD = new LatLng(43.828652, -79.095277);
      HD =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(homeD)
                  .title("Home Depot")
                  .snippet("http://www.homedepot.ca"));

      // TRCA PARKS

      LatLng pettiCoat = new LatLng(43.800112, -79.111113);
      petti =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(pettiCoat)
                  .title("Petticoat Creek")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/petticoat-creek-conservation-area.dot#sthash.oe0iqEiO.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng albionHills = new LatLng(43.930595, -79.827057);
      alb =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(albionHills)
                  .title("Albion Hills Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/albion-hills.dot#sthash.k6WWb4a6.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng boydConservation = new LatLng(43.809569, -79.588049);
      boyd =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(boydConservation)
                  .title("Boyd Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/boyd-conservation-area.dot#sthash.bCcnRX4B.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng bruces = new LatLng(43.948289, -79.350158);
      bruce =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(bruces)
                  .title("Bruce's Mill Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/bruces-mill-conservation-area.dot#sthash.WksUJ2dh.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng haffy = new LatLng(43.935717, -79.954514);
      glen =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(haffy)
                  .title("Glen Haffy Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/glen-haffy-conservation-area.dot#sthash.I1io9pDj.zokMG3s2.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng heartlake = new LatLng(43.741208, -79.787867);
      glen =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(heartlake)
                  .title("Heart Lake Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/heart-lake-conservation-area.dot#sthash.4sIzRbfs.dpbs")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng bcpv = new LatLng(43.774259, -79.515567);
      blackcreek =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(bcpv)
                  .title("Black Creek Pioneer Village")
                  .snippet("http://www.blackcreek.ca/")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng kcfc = new LatLng(43.832700, -79.592926);
      kourtright =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(kcfc)
                  .title("Kourtright Centre for Conservation")
                  .snippet("http://www.kourtright.org/")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng bggc = new LatLng(43.927748, -79.470202);
      bathurst =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(bggc)
                  .title("Bathurst Glen Golf Course")
                  .snippet("http://www.bathurstglengolf.ca/")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng ilcg = new LatLng(43.832700, -79.592926);
      indianline =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(ilcg)
                  .title("Indian Line Campground")
                  .snippet("http://www.trca.on.ca/enjoy/locations/indian-line-campground.dot")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng cca = new LatLng(43.756721, -79.665482);
      claire =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(cca)
                  .title("ClaireVille Conservation Area")
                  .snippet(
                      "http://www.trca.on.ca/enjoy/locations/claireville-conservation-area.dot")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));

      LatLng ttp = new LatLng(43.620602, -79.337887);
      tommy =
          googleMap.addMarker(
              new MarkerOptions()
                  .position(ttp)
                  .title("Tommy Thompson Park")
                  .snippet("http://www.tommythompsonpark.ca/")
                  .icon(BitmapDescriptorFactory.fromResource(R.drawable.trcamark)));
    } catch (Exception e) {

    }
  }
Ejemplo n.º 22
0
  @Override
  public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
    // restaurants

    // TODO Auto-generated method stub
    switch ((int) arg2) {
      case 0:
        petti.setVisible(false);
        boyd.setVisible(false);
        alb.setVisible(false);
        bruce.setVisible(false);
        glen.setVisible(false);
        blackcreek.setVisible(false);
        kourtright.setVisible(false);
        bathurst.setVisible(false);
        indianline.setVisible(false);
        claire.setVisible(false);
        tommy.setVisible(false);
        RB.setVisible(false);
        LP.setVisible(false);
        BP.setVisible(false);
        NF.setVisible(true);
        NF.showInfoWindow();
        M.setVisible(true);
        M.showInfoWindow();
        FC.setVisible(true);
        FC.showInfoWindow();
        BD.setVisible(false);
        WD.setVisible(false);
        MB.setVisible(false);
        MC.setVisible(false);
        CTS.setVisible(false);
        HD.setVisible(false);
        break;
      case 1:
        petti.setVisible(false);
        boyd.setVisible(false);
        alb.setVisible(false);
        bruce.setVisible(false);
        glen.setVisible(false);
        blackcreek.setVisible(false);
        kourtright.setVisible(false);
        bathurst.setVisible(false);
        indianline.setVisible(false);
        claire.setVisible(false);
        tommy.setVisible(false);
        RB.setVisible(false);
        LP.setVisible(false);
        BP.setVisible(false);
        MC.setVisible(true);
        MB.setVisible(true);
        WD.setVisible(true);
        BD.setVisible(true);
        NF.setVisible(false);
        M.setVisible(false);
        FC.setVisible(false);
        CTS.setVisible(false);
        HD.setVisible(false);
        break;
      case 2:
        petti.setVisible(false);
        boyd.setVisible(false);
        alb.setVisible(false);
        bruce.setVisible(false);
        glen.setVisible(false);
        blackcreek.setVisible(false);
        kourtright.setVisible(false);
        bathurst.setVisible(false);
        indianline.setVisible(false);
        claire.setVisible(false);
        tommy.setVisible(false);
        RB.setVisible(true);
        LP.setVisible(true);
        BP.setVisible(true);
        NF.setVisible(false);
        M.setVisible(false);
        FC.setVisible(false);
        BD.setVisible(false);
        WD.setVisible(false);
        MB.setVisible(false);
        MC.setVisible(false);
        CTS.setVisible(false);
        HD.setVisible(false);
        break;
      case 3:
        petti.setVisible(false);
        boyd.setVisible(false);
        alb.setVisible(false);
        bruce.setVisible(false);
        glen.setVisible(false);
        blackcreek.setVisible(false);
        kourtright.setVisible(false);
        bathurst.setVisible(false);
        indianline.setVisible(false);
        claire.setVisible(false);
        tommy.setVisible(false);
        CTS.setVisible(true);
        HD.setVisible(true);
        RB.setVisible(false);
        LP.setVisible(false);
        BP.setVisible(false);
        NF.setVisible(false);
        NF.setVisible(false);
        M.setVisible(false);
        FC.setVisible(false);
        BD.setVisible(false);
        WD.setVisible(false);
        MB.setVisible(false);
        MC.setVisible(false);
        break;
      case 4:
        petti.setVisible(true);
        boyd.setVisible(true);
        alb.setVisible(true);
        bruce.setVisible(true);
        glen.setVisible(true);
        blackcreek.setVisible(true);
        kourtright.setVisible(true);
        bathurst.setVisible(true);
        indianline.setVisible(true);
        claire.setVisible(true);
        tommy.setVisible(true);
        CTS.setVisible(false);
        HD.setVisible(false);
        RB.setVisible(false);
        LP.setVisible(false);
        BP.setVisible(false);
        NF.setVisible(false);
        NF.setVisible(false);
        M.setVisible(false);
        FC.setVisible(false);
        BD.setVisible(false);
        WD.setVisible(false);
        MB.setVisible(false);
        MC.setVisible(false);
        break;
    }
  }
Ejemplo n.º 23
0
 @Override
 public void onMapClick(LatLng position) {
   mMarker.setPosition(position);
   mMarker.showInfoWindow();
 }