Browse Source

Add map marker icons

master
Apostolos Fanakis 6 years ago
parent
commit
0be3bc426a
  1. 74
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/java/gr/auth/databases/flavours/MainActivity.java
  2. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/bar_marker.png
  3. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/cafeteria_marker.png
  4. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/fast_food_marker.png
  5. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/pub_marker.png
  6. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/restaurant_marker.png
  7. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/bar_marker.png
  8. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/cafeteria_marker.png
  9. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/fast_food_marker.png
  10. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/pub_marker.png
  11. BIN
      UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/restaurant_marker.png

74
UI/AndroidApp/flavoursWithoutBorders/app/src/main/java/gr/auth/databases/flavours/MainActivity.java

@ -1,11 +1,13 @@
package gr.auth.databases.flavours; package gr.auth.databases.flavours;
import android.graphics.BitmapFactory;
import android.os.Bundle; import android.os.Bundle;
import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.MarkerOptions;
@ -39,9 +41,73 @@ public class MainActivity extends FragmentActivity implements OnMapReadyCallback
public void onMapReady(GoogleMap googleMap) { public void onMapReady(GoogleMap googleMap) {
mMap = googleMap; mMap = googleMap;
// Add a marker in Sydney and move the camera // Add markers and move the camera
LatLng sydney = new LatLng(-34, 151); LatLng uFleku = new LatLng(40.6357, 22.9367);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); LatLng sSyxronaEstiatoria = new LatLng(40.6173, 22.9597);
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); LatLng uFlekuGarden = new LatLng(40.6354, 22.937);
LatLng mcDonalds = new LatLng(40.6463, 22.9206);
LatLng grill15 = new LatLng(40.6215, 22.961);
LatLng butterfliesAndHurricanes = new LatLng(40.6147, 22.9609);
LatLng theHoppyPub = new LatLng(40.6279, 22.9489);
LatLng bellevilleSinPatron = new LatLng(40.6337, 22.9518);
LatLng aitheroploo = new LatLng(40.6144, 22.9598);
LatLng odysseas = new LatLng(40.6369, 22.9534);
LatLng pulp = new LatLng(40.6321, 22.9479);
LatLng mcDonalds2 = new LatLng(40.5745, 22.9715);
LatLng gianoula = new LatLng(40.64, 22.9468);
mMap.addMarker(new MarkerOptions()
.position(uFleku)
.title("U Fleků")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.pub_marker)));
mMap.addMarker(new MarkerOptions()
.position(sSyxronaEstiatoria)
.title("Σ σύγχρονα εστιατόρια")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.restaurant_marker)));
mMap.addMarker(new MarkerOptions()
.position(uFlekuGarden)
.title("U Fleků Garden")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.pub_marker)));
mMap.addMarker(new MarkerOptions()
.position(mcDonalds)
.title("McDonald\'s")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.fast_food_marker)));
mMap.addMarker(new MarkerOptions()
.position(grill15)
.title("Grill 15")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.fast_food_marker)));
mMap.addMarker(new MarkerOptions()
.position(butterfliesAndHurricanes)
.title("Butterflies and Hurricanes")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.cafeteria_marker)));
mMap.addMarker(new MarkerOptions()
.position(theHoppyPub)
.title("The Hoppy Pub")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.pub_marker)));
mMap.addMarker(new MarkerOptions()
.position(bellevilleSinPatron)
.title("Belleville sin patron")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bar_marker)));
mMap.addMarker(new MarkerOptions()
.position(aitheroploo)
.title("Αιθερόπλοο")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.pub_marker)));
mMap.addMarker(new MarkerOptions()
.position(odysseas)
.title("Οδυσσέας")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.restaurant_marker)));
mMap.addMarker(new MarkerOptions()
.position(pulp)
.title("Pulp")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.bar_marker)));
mMap.addMarker(new MarkerOptions()
.position(mcDonalds2)
.title("McDonald\'s")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.fast_food_marker)));
mMap.addMarker(new MarkerOptions()
.position(gianoula)
.title("Γιαννούλα")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.restaurant_marker)));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(grill15, 12.0f));
} }
} }

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/bar_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/cafeteria_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/fast_food_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/pub_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable-v24/restaurant_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/bar_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/cafeteria_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/fast_food_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/pub_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

BIN
UI/AndroidApp/flavoursWithoutBorders/app/src/main/res/drawable/restaurant_marker.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Loading…
Cancel
Save