So im working on this project that take some addresses and puts them a
map. Which works fine and i have no problem displaying the different
points. But, what im trying to do now is assign different .png markers
to each of the points so i get something like a-z points on the
map....
Heres a snip-it of this section of code:
List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable =
this.getResources().getDrawable(R.drawable.marker);
Marker itemizedoverlay = new Marker(drawable, this);
Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
mapOverlays.clear(); //just in case clearing old values
List<Address> address =
geoCoder.getFromLocationName( location
, 1);
GeoPoint zero = new GeoPoint(
(int)
(address.get(0).getLatitude() * 1E6),
(int)
(address.get(0).getLongitude() * 1E6));
OverlayItem overlayZero = new OverlayItem(zero,
Tabs.clinics.get(0).getString("name"),
Tabs.clinics.get(0).getString("phone"));
itemizedoverlay.addOverlay(overlayZero);
for(int i = 1; i < tempp; i++)
{
address.addAll(geoCoder.getFromLocationName(location, 1));
itemizedoverlay.addOverlay(new
OverlayItem(new GeoPoint(
(int)
(address.get(i).getLatitude() * 1E6),
(int)
(address.get(i).getLongitude() * 1E6)),
Tabs.clinics.get(i).getString("name"),
Tabs.clinics.get(i).getString("phone")));
}
mapOverlays.add(itemizedoverlay);
i tried :P but this just messed things up:
itemizedoverlay.getItem(i).setMarker(this.getResources().getDrawable(R.drawable.a));
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en