java - How can I show different markers on a map? -
i displaying markers on map. not sure how can specify different drawable resource different markers?
i show green pin if locations distance < 50, etc. etc.
pin = getresources().getdrawable(r.drawable.pushpin); itemizedoverlay = new myitemizedoverlay(pin, mapview); (record element : list) { geopoint point; overlayitem overlayitem; double lat = double.parsedouble(element.getlatitude()); double lng = double.parsedouble(element.getlongitude()); double locationdistance = double.parsedouble(element.getlocationdist()); geopoint.add(new geopoint((int) (lat * 1e6), (int) (lng * 1e6))); listofoverlays = mapview.getoverlays(); point = new geopoint((int) (lat * 1e6), (int) (lng * 1e6)); log.i("deep", "deep " + point); overlayitem = new overlayitem(point, "", element.gettitle()); if(locationdistance < 50){ //green } else if(locationdistance > 50 && locationdistance < 100){ //yellow } else if(locationdistance > 100 && locationdistance < 150){ //blue }
i able user setmarker(). see answer #3:
Comments
Post a Comment