Scalilng Overlays

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Scalilng Overlays

Postby Jondice » Fri Nov 14, 2008 9:55 pm

I'm attempting to scale an overlay image for a map to make it the correct size. Eventually I'll need to do the dynamically for when the user zooms in and out.

I attempted to use ScaleDrawable like so, but this causes a crash:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.         Drawable myIcon = getResources().getDrawable(R.drawable.large);
  3.  
  4.         ScaleDrawable z19 = new ScaleDrawable(myIcon, 0, 500, 500);
  5.  
  6.        
  7.  
  8.         MapController mapController = mapview.getController();
  9.  
  10.         mapController.setZoom(19);
  11.  
  12.         mapController.setCenter(centerCM);
  13.  
  14.         List<Overlay> l = mapview.getOverlays();
  15.  
  16.         l.add(new MapOverlay((Drawable) z19, mapview));
  17.  
  18.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


If on the last line I use myIcon instead of z19, there are no problems (other than the overlay not being the desired size).



Adb isn't telling me anything at the moment.

Appreciate any suggestions!
Jondice
Freshman
Freshman
 
Posts: 3
Joined: Sun Nov 09, 2008 12:06 am

Top

Postby Jondice » Sat Nov 15, 2008 2:29 am

Nevermind, realized SetBound does what I need.
Jondice
Freshman
Freshman
 
Posts: 3
Joined: Sun Nov 09, 2008 12:06 am

Postby Cheefrocker » Thu Jan 01, 2009 5:25 pm

Hi guys,

i want place a scalable icon on a mapview. it must scale the icon depends on the zoomlevel. how can i do this?
I use a ItemizedOverlay but i cant modify the drawable. the normal drawable works. can i use scaledrawable and how can i use it?

thx all
Cheefrocker
Freshman
Freshman
 
Posts: 4
Joined: Sat Feb 02, 2008 11:58 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests