use of com.google.android.gms.maps.model.MarkerOptions in project android-maps-utils by googlemaps.
the class GeoJsonPointStyle method toMarkerOptions.
/**
* Gets a new MarkerOptions object containing styles for the GeoJsonPoint
*
* @return new MarkerOptions object
*/
public MarkerOptions toMarkerOptions() {
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.alpha(mMarkerOptions.getAlpha());
markerOptions.anchor(mMarkerOptions.getAnchorU(), mMarkerOptions.getAnchorV());
markerOptions.draggable(mMarkerOptions.isDraggable());
markerOptions.flat(mMarkerOptions.isFlat());
markerOptions.icon(mMarkerOptions.getIcon());
markerOptions.infoWindowAnchor(mMarkerOptions.getInfoWindowAnchorU(), mMarkerOptions.getInfoWindowAnchorV());
markerOptions.rotation(mMarkerOptions.getRotation());
markerOptions.snippet(mMarkerOptions.getSnippet());
markerOptions.title(mMarkerOptions.getTitle());
markerOptions.visible(mMarkerOptions.isVisible());
return markerOptions;
}
use of com.google.android.gms.maps.model.MarkerOptions in project android-maps-utils by googlemaps.
the class IconGeneratorDemoActivity method addIcon.
private void addIcon(IconGenerator iconFactory, CharSequence text, LatLng position) {
MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon(text))).position(position).anchor(iconFactory.getAnchorU(), iconFactory.getAnchorV());
getMap().addMarker(markerOptions);
}
use of com.google.android.gms.maps.model.MarkerOptions in project Space-Station-Tracker by Kiarasht.
the class MapsActivity method onMapReady.
/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMaptype();
if (mTimer == null) {
mTimer = new Timer();
}
// Every 90 minutes, update the polylines automatically
if (mPolyTimer == null) {
mPolyTimer = new Timer();
TimerTask hourlyTask = new TimerTask() {
@Override
public void run() {
asyncTaskPolyline();
}
};
// 90 minutes
mPolyTimer.schedule(hourlyTask, 0L, 5400000);
}
mMarkerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.iss_2011));
mMarkerOptions.anchor(0.5f, 0.5f);
mTimer.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
trackISS();
}
}, 0, mRefreshrate);
}
use of com.google.android.gms.maps.model.MarkerOptions in project RSAndroidApp by RailwayStations.
the class MapsActivity method addMarkers.
private void addMarkers(List<Bahnhof> bahnhofMarker, LatLng myPos) {
for (Bahnhof bahnhof : bahnhofMarker) {
LatLng bahnhofPos = bahnhof.getPosition();
mMap.addMarker(new MarkerOptions().title(bahnhof.getTitle()).position(bahnhofPos).snippet(String.valueOf(bahnhof.getId())).icon(BitmapDescriptorFactory.defaultMarker(343)));
}
// Add a marker and moves the camera
mMap.addMarker(new MarkerOptions().position(myPos).title("Meine aktuelle Position: ").icon(BitmapDescriptorFactory.defaultMarker(55)));
mMap.setInfoWindowAdapter(this);
mMap.setOnInfoWindowClickListener(this);
}
use of com.google.android.gms.maps.model.MarkerOptions in project RSAndroidApp by RailwayStations.
the class MapsAllActivity method addAllMarkers.
private void addAllMarkers(List<Bahnhof> bahnhofMarker) {
for (int i = 0; i < bahnhofMarker.size(); i++) {
LatLng bahnhofPos = new LatLng(bahnhofMarker.get(i).getLat(), bahnhofMarker.get(i).getLon());
mMap.addMarker(new MarkerOptions().title(bahnhofMarker.get(i).getTitle()).position(bahnhofPos).snippet(String.valueOf(bahnhofMarker.get(i).getId())).icon(BitmapDescriptorFactory.defaultMarker(343)));
mMap.setInfoWindowAdapter(this);
mMap.setOnInfoWindowClickListener(this);
}
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myPos, 7));
}
Aggregations