El clima de Android 'MapView' como superposición

https://lh3.googleusercontent.com/-A6VHppSxRyk/TrkVmkzTPDI/AAAAAAAACaQ/sEDVPWNcmIs/s293/Untitled.png

I am trying to show weather condition in my map as shown above, How can I implement this?

preguntado el 08 de noviembre de 11 a las 12:11

Can you generate the weather overlay as a bitmap? -

cant say, actually i don't know how data is coming from server in KML format and how to parse that data to show overlay. any tutorial will help... Thank You -

The overlay you show in lh3.googleusercontent.com/-A6VHppSxRyk/TrkVmkzTPDI/AAAAAAAACaQ/… is a bitmap, no way you could/should generate cloud images like this client-side from vector based data -

This is screen from app from Android market ::market.android.com/…, Could you drop some light on this, Like how they achieving this map from data.? -

Inherit from MapActivity, make a normal layout with the buttons etc, and a FrameLayout in the center where you in upper layer place a RelativeLayout with the two buttons and in the lower layer (the first you add) place a MapView. In the MapView you add an overlay with a semi-transparent bitmap as shown in my answer. The bitmap you generate server-side. -

1 Respuestas

Make a class that extends Overlay and add it as overlay. In tha class you override

@Override
public void draw(Canvas c, MapView mapView, boolean shadow) {
  //super.draw(c, mapView, shadow);

  if (shadow) return; // no shadows

  Rect canvasRekt = new Rect(0, 0, c.getWidth(), c.getHeight());
  Rect kortRekt = ...

  c.drawBitmap(overlejretKort, canvasRekt, kortRekt, paint);
  c.drawRect(kortRekt, paint);
}

The kortRekt should contain the rectangle of your bitmap (here its called overlejretKort)

respondido 08 nov., 11:17

Heres a full example, showing some geological information overlayed: code.google.com/p/android-eksempler/source/browse/trunk/… - Jacob Nordfalk

Note that there's some bookkeeping to do to make it overlay at the right place, and some work to load weater overlay tiles asynchroneously over the net. It took a day's fiddling to get my example to work, and it still doesent always draw the overlay in the correct place. - Jacob Nordfalk

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.