How to implement text frame overlay on MapView?

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

Postby bugtester » Sun Nov 01, 2009 6:00 pm

burakkilic wrote:Pin to a geo point on the map. I add it to the overlays of the mapview. And in the onTap method, I get the OverlayItem and pop the layout that I want.


I have a bit confuse. May I clarify something. Do you mean you added a marker (Drawable) Overlay, not table view to the mapview and do some implementation on OnTap function to pop the layout?
And may I know do mean you pop the layout by popupwindow class? Thanks.
bugtester
Freshman
Freshman
 
Posts: 8
Joined: Sun Nov 01, 2009 7:42 am

Top

Postby burakkilic » Sun Nov 01, 2009 7:01 pm

Ok,let me tell u again.first, do the same things in the hellomapview tutorial. And then if you want to add extra information and clickable buttons when somebody taps on that marker,handle the ontap event.in the ontap event,you must use inflater to populate buttons,links etc. So your application will be like the google maps on the web.i mean shows popups info boxes etc.
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Postby bugtester » Mon Nov 02, 2009 12:55 am

burakkilic wrote:Ok,let me tell u again.first, do the same things in the hellomapview tutorial. And then if you want to add extra information and clickable buttons when somebody taps on that marker,handle the ontap event.in the ontap event,you must use inflater to populate buttons,links etc. So your application will be like the google maps on the web.i mean shows popups info boxes etc.


Thank for you answer. I found your code in the other thread. I will try it. But I wonder will the poped layout position follow the location when drag drop the map. If yes, it really give me a very big hand
bugtester
Freshman
Freshman
 
Posts: 8
Joined: Sun Nov 01, 2009 7:42 am

Postby burakkilic » Mon Nov 02, 2009 1:02 am

As i said before,it sticks to the geopoint(longitude,latitude) so when you drag the map,it stays on the geolocation.
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Postby bugtester » Mon Nov 02, 2009 1:04 am

Ha-ha, I found the magic in your code, it is able to pass geopoint to the layoutparms. I will try it. Thank you so much.
bugtester
Freshman
Freshman
 
Posts: 8
Joined: Sun Nov 01, 2009 7:42 am

Postby burakkilic » Mon Nov 02, 2009 2:21 am

You re welcome
burakkilic
Developer
Developer
 
Posts: 37
Joined: Thu Oct 01, 2009 10:24 am

Top

Postby r3pek » Thu Dec 03, 2009 11:42 pm

I'm sorry to bring this back up again but can someone show me a peice of code that does this? I'm trying to make something similar to this that is create a ballon with some text and buttons inside when i click on a OverlayItem from a ItemizedOverlay. I just didn't figure it out yet how to do it :(
r3pek
Freshman
Freshman
 
Posts: 3
Joined: Thu Dec 03, 2009 11:37 pm

Postby bugtester » Fri Dec 04, 2009 1:51 am

r3pek wrote:I'm sorry to bring this back up again but can someone show me a peice of code that does this? I'm trying to make something similar to this that is create a ballon with some text and buttons inside when i click on a OverlayItem from a ItemizedOverlay. I just didn't figure it out yet how to do it :(


Use MapView.addView instead, you will find that there is an parameter about location.
bugtester
Freshman
Freshman
 
Posts: 8
Joined: Sun Nov 01, 2009 7:42 am

Postby r3pek » Fri Dec 04, 2009 11:13 am

ok, here's what i'm doing:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         public boolean onTap(GeoPoint p, MapView mapView) {
  2.  
  3.                 LayoutInflater inflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  4.  
  5.                 LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, p, LayoutParams.CENTER);
  6.  
  7.                 LinearLayout ll = (LinearLayout)inflater.inflate(R.layout.map_baloon, null);
  8.  
  9.                 mapView.addView(ll, lp);
  10.  
  11.                 return true;
  12.  
  13.         }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


the map_baloon is just a linearlayout with a textview on it.
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
  2.  
  3. <TextView android:text="@+id/TextView01" android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
  4.  
  5. </LinearLayout>
  6.  
  7.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4



But nothing appears on screen :( What am i doing wrong?


EDIT: Looks like i'm not doing anything wrong. the view is just added to the wrong GeoPoint (how?!?!)

EDIT2: Figured it out :) Instead of FILL_PARENT on layout params we should WRAP_CONTENT :D

Thanks for the help
r3pek
Freshman
Freshman
 
Posts: 3
Joined: Thu Dec 03, 2009 11:37 pm

Postby Droid123 » Mon Dec 21, 2009 12:26 pm

Does your popup balloon look like the balloon in the picture. Basically a rectangle with a pointed edge like a comic-balloon?
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top
Previous

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 2 guests