anticafe
anticafe

Reputation: 6892

Can we have different kind of marker in the same Android mapview?

Take a look at this screenshot

enter image description here

I wonder how can we add different kind of marker in the same Android mapview? Because we must create a list of overlays with fivent drawable, and cannot change this drawable (marker) later.

List<Overlay> mapOverlays = mapView.getOverlays();
        Drawable drawable = Activity.this.getResources().getDrawable(R.drawable.icon);
        MyItemizedOverlay itemizedOverlay = new MyItemizedOverlay(drawable ,Activity.this);

        GeoPoint point = new GeoPoint( (int)(location.getLatitude()*1000000),
                (int)(location.getLongitude()*1000000));

     OverlayItem overlayitem = new OverlayItem(point, "Current Location :","+acTextView.getText());

        itemizedOverlay.addOverlay(overlayitem);
        mapOverlays.add(itemizedOverlay);
        MapController mapController = mapView.getController();

        mapController.animateTo(point);
        mapController.setZoom(14); 

Upvotes: 0

Views: 1164

Answers (1)

slkorolev
slkorolev

Reputation: 6001

At least you can define more than one overlay, each one with its own marker. No? And also you can override ItemizedOveralay.draw

Upvotes: 2

Related Questions