How does GoogleMaps overlay widgets on the MapView?

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

How does GoogleMaps overlay widgets on the MapView?

Postby jackck » Sat Mar 08, 2008 6:51 am

The GoogleMaps preloaded on the emulator is very elegant. If you search for say 'Pizza sf', it can show all sort of really fancy overlays on top of the map. These overlays contain what looks like ListView, Buttons, TextViews etc.

I am a newbie at map Overlay and I only know how to draw text and shapes (circles, rectangles etc) on the MapView, but I don't know how can I overlay arbitrary widgets on the map? Attached .gif is a screenshot of the GoogleMaps overlay which I am interested in making in my app.

Any help is appreciated!
Attachments
googlemaps.gif
(34.11 KiB) Downloaded 340 times
User avatar
jackck
Freshman
Freshman
 
Posts: 4
Joined: Thu Feb 21, 2008 5:26 am

Top

Postby plusminus » Sat Mar 08, 2008 5:15 pm

Hello Jack,

on how to make MapOverlays, have a look at:

http://www.anddev.org/viewtopic.php?t=92
and
http://www.anddev.org/viewtopic.php?t=826

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

floating window

Postby jackck » Mon Mar 10, 2008 2:02 am

Thanks for the tutorials plusminus. They are excellent. But what I really need is to know how to implement a floating window/activity on top on a MapView.

You tutorial doesn't seem to have such a floating window.
User avatar
jackck
Freshman
Freshman
 
Posts: 4
Joined: Thu Feb 21, 2008 5:26 am

Postby plusminus » Mon Mar 10, 2008 2:46 pm

Hello jackck,

what you call a floating dialog is a simple Activity with a Dialog-Theme.

Simply call :darrow: before calling [font=Lucida Console]setContentView(..)[/font];
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.setTheme(android.R.style.Theme_Dialog);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Android Dialog

Postby biosopher » Sat Mar 15, 2008 8:32 pm

Hi Jackck,

Your image shows a Dialog containing a ListView. There are several examples of using Dialogs in Android's Demo API.

I have just completed a tutorial adding transparent panels to a MapView that you can view here:

http://blog.pocketjourney.com/2008/03/1 ... p/#respond

Although I think my tutorial will help you some and recommend that you check it out, DON'T use my transparent panel approach to create the exact image you've posted above. For that, embed a ListView into a Dialog. I'm working on a 2nd tutorial that shows how to best use transparent panels in MapViews. E.g. you need a transparent panel as in my tutorial if you want to overlay navigation buttons onto a MapView as you see at the bottom of Android's Google Map when viewing directions.

Best of luck,
acopernicus
biosopher
Developer
Developer
 
Posts: 26
Joined: Sat Mar 15, 2008 8:14 pm
Location: San Francisco, California

Hi jackck

Postby CHAKYANAS » Thu Mar 20, 2008 10:44 am

I am sure that thet is not an overlay wht ur .gif file is showing......
that is a pop up window with transparent background and upon that the widgets..............
you can have a look on this code
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.          public static  PopupWindow pw = null;
  2.  
  3.  
  4.  
  5.  
  6.  
  7.            pw = new PopupWindow(currentActivity.getViewInflate().inflate(R.layout.camara,null,null),0,0);
  8.  
  9.             pw.show(currentActivity.findViewById(R.id.mainId),0 ,100);
  10.  
  11.             pw.update(20,20,275,375);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
User avatar
CHAKYANAS
Developer
Developer
 
Posts: 44
Joined: Mon Mar 03, 2008 5:08 am
Location: INDIA

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests