Search in sources :

Example 6 with MarkerOptions

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;
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions)

Example 7 with 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);
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions)

Example 8 with 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);
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) Timer(java.util.Timer) TimerTask(java.util.TimerTask)

Example 9 with MarkerOptions

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);
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) Bahnhof(de.bahnhoefe.deutschlands.bahnhofsfotos.model.Bahnhof) LatLng(com.google.android.gms.maps.model.LatLng)

Example 10 with MarkerOptions

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));
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) LatLng(com.google.android.gms.maps.model.LatLng)

Aggregations

MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)38 LatLng (com.google.android.gms.maps.model.LatLng)23 BitmapDescriptor (com.google.android.gms.maps.model.BitmapDescriptor)7 Marker (com.google.android.gms.maps.model.Marker)6 GoogleMap (com.google.android.gms.maps.GoogleMap)5 Bitmap (android.graphics.Bitmap)4 View (android.view.View)4 Document (org.w3c.dom.Document)4 OnClickListener (android.view.View.OnClickListener)3 GoogleDirection (app.akexorcist.gdaplibrary.GoogleDirection)3 OnDirectionResponseListener (app.akexorcist.gdaplibrary.GoogleDirection.OnDirectionResponseListener)3 OnMapReadyCallback (com.google.android.gms.maps.OnMapReadyCallback)3 PolylineOptions (com.google.android.gms.maps.model.PolylineOptions)3 RemoteImageLoader (com.omkarmoghe.pokemap.helpers.RemoteImageLoader)3 TextView (android.widget.TextView)2 OnAnimateListener (app.akexorcist.gdaplibrary.GoogleDirection.OnAnimateListener)2 CameraPosition (com.google.android.gms.maps.model.CameraPosition)2 CircleOptions (com.google.android.gms.maps.model.CircleOptions)2 PokemonIdOuterClass (POGOProtos.Enums.PokemonIdOuterClass)1 FortDataOuterClass (POGOProtos.Map.Fort.FortDataOuterClass)1