Android :: Android Maps Overlay OnTap Click

May 5, 2010

Could anyone help me with my below program. I'm unable to put a transparent label containing the contents from my HelloGoogleMaps.java class (Hola, Mundo!) when i click the markers(the android icon) in the map. I would like to have the ontap event do it for different markers here so that that particular location details is popped up. It needs to be in a canvas display. Upon clicking this new canvas label, it should take me to a seperate activity displaying complete details. I'm using the sample program given in the Google Android Website http://developer.android.com/resources/tutorials/views/hello-mapview and i want to extended it to the next level. Import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; import android.app.Activity; import android.graphics.drawable.Drawable; import android.os.Bundle;

Android :: Android Maps Overlay onTap click


Android :: Launching Activity From Overlay OnTap

Feb 10, 2009

I am wondering if I am going about this problem the correct way.I am making an app that places overlays on top of google maps.When you click on the overlay it should launch a dialog type window that will give you options on what to do with that overlay.It is the line startActivity where the app throws an exception.I did the setFlags because an error message said it was needed because I was trying to start the Activity while outside an Activity.That makes me think I am going about this wrong.I have 'MyActivity' listed in my manifest so I don't think that is the issue.I have searched for this problem on the internet and I can't seem to find anyone else running into this so that is another reason I think I may be trying to do this the wrong way.

View 3 Replies View Related

Android :: Starting Activity In Overlay OnTap?

Feb 10, 2009

I am attempting to launch a dialog type window when I click an Overlay that has been placed on google maps. I thought the way I would do this was Override the onTap() method, create an intent, and call startActivity on that intent as follows:

CODE:..........

It looks like the program throws an ActivityNotFoundException when executing that last line. The exception reads that if you try to start an Activity while you are not in an Activity you need to set the FLAG_ACTIVITY_NEW_TASK flag which is why that line is there. I have included MyActivity in my manifest.

'context' is passed to my class constructor that extends Overlay and is the MapActivity that I am using to display the map.

View 2 Replies View Related

Android :: Overlay OnTap Not Working After Back Button?

Jul 29, 2010

I have several Overlays drawn on a MapView with ItemizedOverlay, and an onTap that works when I first start my app. However, if I press the Back button on the Android then start my app again the onTap does not work at all. Other touch sensative operations work fine, like long press on the map and several face buttons. It is also fine if I press the Home button on the phone then go back into my app, so its only on the Back button. It will also work if I first open another app like the Maps app, then go back into my app, acting like a reset.

Overriding the onBackPressed method to move the task to the background also does not work, does anyone have any ideas what would cause this? It happens in both the emulator and on a real device.

I don't know if it will help but here is the relevent code:

CODE:...........................

View 1 Replies View Related

Android :: How To Return Location Pressed To MapActivity From An Overlay OnTap Method

Aug 30, 2010

I have an activity that has a button which opens a new MapActivity to select a location by tapping on the map.

The map has an overlay that overrides the onTap method to get the location but I want to return that location to the previous activity but, I don't know how to return the geopoint to the mapactivity in order to call the setResult() and finish() methods, because I can't call them from the Overlay.onTap method.

View 2 Replies View Related

Android :: Android Map Overlay OnTouchEvent / OnTap How To?

Apr 9, 2010

I've implemented a Class that extends Overlay and also override the onTap / onTouchEvent (tried both). Right now it seems like that event is triggered when you tap on the map regardless of position.How can I make sure that the event is triggered only when you tap over the overlay you have added?

View 2 Replies View Related

Android :: Start Activity From Overlay In Maps

Jul 22, 2010

I am trying to create a map application and I need to do something similar to what Google Maps does. I want to open show a list of locations and when user taps on them I want to show a dialog.

I was able to do it till here. But now when the user clicks on the dialog that opened I want to show another acttivity with the details of that item that they clicked on.

I tried to start a new intent but it gives me an error.

Here is what I am doing

CODE:...................

Here is the stack trace E/AndroidRuntime( 4985): java.lang.RuntimeException:

Unable to start activity ComponentInfo{com.achie.test.mapssample/ com.achie.test.mapssample.ItemDetailView}:

CODE:........

Why am I getting this error and how can I resolve this and open a new activity?

Also where can I find the source code for the google maps on android?

View 4 Replies View Related

Overlay Bitmaps With Click Of Button

Oct 27, 2011

I am currently working on an app and I want to lay a Bitmap over the Google Maps bitmap with the click of a button. I am assuming this is possible, and maybe a lot easier than I'm making it.

class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)

[Code] ......

View 1 Replies View Related

Android :: Detecting Clicks On A Google Maps Overlay

Jun 15, 2009

I would like to put a bunch of dots on a google map, and have the appropriate listener called when one of them gets clicked.All i seem to be able to find is to get the location at which the click occurred, and then iterate through the dots until I find one that I think matches. Is there no listener for an arbitrary shape, like a drawable? I feel like this might be a Java question more so than android, but hopefully someone can still answer it.

View 3 Replies View Related

Android :: Phone Maps Support Ground Overlay?

Jun 8, 2010

I have a weather image I would like to use as an overlay in the google maps android api. I would like to achieve the same result that I get from using GroundOverlay in KML files, such as

<GroundOverlay>
<name>myimage</name>
<Icon>
<href>myimage.png</href>
<viewBoundScale>0.75</viewBoundScale>
</Icon>
<LatLonBox>
<north>75.6088</north>
<south>5.0121</south>
<east>182.2805</east>
<west>120.6795</west>
</LatLonBox>
/GroundOverlay>

The above will ensure that the 4 corners of my image stay anchored to the 4 lat/long points listed, regardless of scrolling, zooming etc. Is there a way to accomplish this using the google api / maps provided for android?

View 1 Replies View Related

Android :: Expanding Overlay Marker On Google Maps?

Jul 20, 2010

I can draw overlay items onto google maps just fine, an image that looks like:
_____
| |
______
/

Where the "/" part is the "pin" that marks the lat/lon on the map and a picture in the middle of it. My question is, is there any way to expand this when the user clicks on it? I'll of course have to change this to some kind of dialog or layout and change it when it gets clicked.

I want to have it smaller like that with just an image when not clicked on, but when it is clicked on it expands over like a second to:

--------------------------------------
| <image> <buttons> |
| <buttons> |
| <some info here> |
| |
--------------------------------------
/

Is this possible?

View 2 Replies View Related

Android :: Adding Items To Maps Overlay Does Not Immediately Show On Map

Aug 28, 2010

I can't figure out how to tell my Map to redraw its overlays once I've updated them. Currently the user has to touch the screen before the map is redrawn.

View 2 Replies View Related

Android :: Threading - Custom Google Maps Tile Overlay

Nov 4, 2010

I've been stuck for ages now trying to implement threading or background image loading for a custom tile overlay class I've been working on. I'm pretty useless when it comes to Java so threading isn't something I've had any experience with. Basically I have extended an ItemizedOverlay and in the draw() method calculate the tiles I need to display over the standard google tiles then fetch those images with a URLConnection and using BitmapFactory decode them and draw them to the canvas at the correct position on the screen so that the images are on top of the google tiles with about 50% opacity (the custom tiles are cellphone network coverage png's which are used for our web app). I initially got this all working with the tiles loading in the correct places but hit issues with memory and "freezing" while panning so implemented some basic caching and memory management to only store the tiles that are displayed on the map in memory and when downloading a tile store it to SD card.

Then I figured the freezing while panning is due to the blocking nature of downloading the images so, have been trying to implement threading. I created a class that extends AsyncTask to download the images in the background and store them to SD, in the onPostExecute method I then try to draw all the tiles. But onPostExecute never seems to fire, now I know that the AsyncTask has to be called in the main ui thread so tried to debug the execution with Thread.currentThread().getId() calls through out the code. The thread Ids through out is 1 and then 10 for the doInBackground method for the AsyncTask. Now I'm not sure if 1 is the main UI thread or not. In the extended MapActivity class I have, the onCreate method's Thread.currentThread().getId() returns 1 but I'm not sure if the MapActivity class is executed in the main ui thread? Here Romain Guy mentions that the onPostExecute method should have @Override but when I do that eclipse flags it as an error

"The method onPostExecute(Boolean...) of type TileCache.ImageLoadTask must override or implement a supertype method"
So I guess something is wrong there but the only fix eclipse offers is to remove the @Override
So I guess with out post all my source code, the question's I have are:
Is the MapActivity onCreate method called in the main ui thread?
What does the @Override error mean? or why does it show that error
Does anyone have an example of a custom tile overlay implementation with background image loading and tile caching?

View 1 Replies View Related

Android :: Not Understanding DrawAt() Method For Com.google .maps.Overlay

Jan 19, 2010

Trying to make an google maps overlay in an android program. Inside of my overlay's draw method, I have two ways of adding a pin. One of them works, and one does not. Unfortunately, the one that does not work is also the only one that has the ability to add a shadow!

CODE:...........................

View 2 Replies View Related

Android : Location/maps - Speed - Delete Overlay Without Deleting All The Others

Oct 26, 2010

I'm messing around with maps and gps and i have some questions. Hope any of you point me in the right direction:

- I´m loading about 400 overlays in a mapview, but it takes 2-3 minutes. Is there any way to speed things up?

- On the other hand, I use another overlay to point device gps position, but when location point change i need to delete this overlay to put it again in it's new position. How can i delete this overlay without deleting all the others?

View 15 Replies View Related

Motorola Droid :: Overlay A Route In Google Maps?

Feb 5, 2010

I am looking for a way to overlay a route in google maps.

What I want is to take this map Greenways Oak Ridge Google map and get it to my google My Maps. Then I can pull it up in Maps and use my location to see where I am in relation to where I need to be in case I want to take a different route to need to shorted the ride due to darkness.

Most rides I do I can find these maps but cant do anything with them.

View 13 Replies View Related

Android :: Google Maps View Crashes On Tap / Click?

Jul 23, 2010

I'm currently writing an app displaying a MapView showing a google map. I used the "hello map view" tutorial from http://developer.android.com/resources/tutorials/views/hello-mapview.html and this works so far: the map is displayed, centered and zoomed correctly, even the OverlayItems I added are displayed correctly. But when I click on one of those overlay items I added, the application crashes with a null pointer exception:

07-23 16:24:48.167: ERROR/AndroidRuntime(2530): java.lang.NullPointerException
07-23 16:24:48.167: ERROR/AndroidRuntime(2530): at com.android.internal.app.AlertController$AlertParams.<init>(AlertController.java:753)
07-23 16:24:48.167: ERROR/AndroidRuntime(2530): at android.app.AlertDialog$Builder.<init>(AlertDialog.java:273)....

View 2 Replies View Related

Android :: Map Open Overlay When Pin Is Clicked - Overlay Contains Description / Button

Aug 18, 2010

I like tu use the MapActivity to display some pins. When a pin is pressed i like to open a description. This can I obtain following the tutorial: http://developer.android.com /resources /tutorials/views/hello-mapview. But now I like to put a button on the overlay window. That button should open a detail activity. How can I make this? How is possible to personalize the overlay "info window"?

View 2 Replies View Related

Android :: ItemizedOverlay.onTap() Imprecise?

Feb 15, 2010

I'm using Google maps. I put the markers on map and my inherited ItemizedOverlay overrides onTap() method.

Markers are 32x32 images.

However, I can tap quite a bit away from the marker and still receive the event. This becomes a problem when markers are close to each other.

View 2 Replies View Related

Android :: ItemizedOverlay Using Both OnTap Methods

Jun 15, 2010

I have a MapView where I would like to be able to tap the map to create a new item at that location if there is no item there, or display the info about the item if there is.

I tried overriding both the onTap(int) and onTap(GeoPoint, MapView) methods but apparently if the second method is overridden the first never gets called (commenting one or the other lets each one work as I expected).

I thought about just checking if an item was at the location, but there doesn't seem to be any handy methods available to do that (other than iterating through the list of items and checking each manually).

View 17 Replies View Related

Android :: Change Drawable OnTap?

Aug 3, 2010

I have an Overlays class named picOverlay which extends ItemizedOverlay<OverlayItem> that uses a drawable named ''overlay''.

I'd like for my application to change the drawable to let's say ''overlay_hover'' when the user touches the overlay.

Can I do this in the onTap method? Can someone enlight me a little bit on how to change the drawable that I'm actually touching?

View 2 Replies View Related

Android :: OnTap Start Dialog?

Aug 28, 2009

I have a mapactivity with multiple ItemizedOverlays and a onTap method when the user clicks on the marker. I can show a toast message but i want to display a Dialog when the user clicks on the marker (so in onTap method). How can i do that?

View 2 Replies View Related

Android :: ItemizedOverlay Adding Items And OnTap?

Feb 4, 2010

When I add a new item to my ItemizedOverlay the onTap display I have set appears X times, where X is equal to the number of items that I added. So for example, if I add one item and tap it, it the onTap method gets called once, and in the LogCat I get:

02-04 23:28:56.188: INFO/NotificationService(52): enqueueToast pkg=android.mapit callback=android.app.ITransientNotification$Stub $Proxy@4394c100 duration=0

If I add a second item and click ANY of the other items, the onTap method gets called twice and I get the following in LogCat:

CODE:.....................

If I add a third item and click ANY of the other items, the onTap method gets called three times and I get the following in LogCat:

CODE:...................................

Any idea why this would occur? I'm running into issues with it affecting other things like removal of items.

View 2 Replies View Related

Android :: OnTap Display Toast Or Message

Jul 13, 2009

I looked for any information about onTap event processing for itemized overlays in this group. There is a lot of useful information but I could not find the answer to one question.

The tutorial by Mark Murphy on itemized overlays, http://androidguys.com/?p=1413

describes how to generate a Toast message whenever an onTap event occurs. In his case, the custom itemized overlay activity is included in the main activity. In my case, it is not. My custom itemized overlay activity is included in the application package as a public activity.

This means that the line Toast.makeText(NooYawk.this, items.get(i).getSnippet(), Toast.LENGTH_SHORT).show(); will not work "as is".

I have had trouble in correctly identifying the context for the Toast. Attempts to use the main class' (the one calling the custom itemized overlay class) context have not worked. I would appreciate it if anyone could suggest how I could resolve this issue. Incorporating the custom itemized overlay class in the main class is not a desirable option.

Alternatively, I would appreciate any suggestions for generating a display of the title and/or snippet information for markers on a map.

The onTap event works fine (Log.i statements in the onTap method display the correct information for each marker tapped)

View 7 Replies View Related

Android : Show Popup In MapLocationOverlay.onTap?

Oct 12, 2010

I'm trying to display a popup in a MapView. I m doing this in myLocationOverlay.onTap() method. I got the initial popup to display correctly. I have a button in the popup to expand the popup by making some hidden view visible and changing the height of the popup like this..

but the height of the popup doesn't seems to change. Am I missing something here?

View 2 Replies View Related

Android :: How To Scale Markers And Set Shadow And OnTap Correctly

Nov 17, 2009

I'm scaling markers on a MapView with the following code

CODE:.........

And:

CODE:.............

Which works, but the shadow below the marker has wrong offset when scaled. Also; i override the public boolean onTap(int index) in ItemizedOverlay to detect taps on the markers, but it seems inaccurate. I can click some range outside the marker and still trigger onTap...

View 1 Replies View Related

Android :: ListView Selection - Make Only Item Click Be Effected By Click?

Apr 1, 2010

when I click on one item in the ListView that item's background changes to light gray, but when I continue to scroll through the list every 4th item has the background changed to light gray even though those other items have not been clicked. How do I make only the item I clicked be effected by the click?

ListView lv = (ListView) findViewById(R.id.resultsList);
lv.setAdapter(new ArrayAdapter(this, R.layout.resultitem, (String[])labelList.toArray(new String[labelList.size()])));
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View view, int position, long id) {
TextView tv = (TextView)view.findViewById(R.id.result);
tv.setBackgroundColor(Color.LTGRAY);
tv.setTextColor(Color.BLACK);

View 1 Replies View Related

Android :: Catching Both Click And Long Click On ListView

May 3, 2010

I have a ListView in my Activity. I am trying to catch both a click and a long click (which should bring up a context menu).

ListView lv = (ListView) findViewById(R.id.MyListView); ... lv.setOnItemClickListener(this); lv.setOnCreateContextMenuListener(this); ...

I notice that if I have both the click and long click listeners up, I won't ever get the long click listener (i.e. the context menu). If I remove the setOnItemClickListener() call, i get a call into

@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {

You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at

View 4 Replies View Related

Android :: Click To Expand List -and- Click On A Button?

May 31, 2010

I have just started my career as an android programmer, and am currently relying heavily on the sample code and api examples. I have been working with this api example, to produce an expandable list of items (note this example does not use the ExpadableListView).In playing with the example, I tried to add another widget that would become visible and be gone at the same time as the text (mDialogue in the sample code). This works well with another TextView, but as soon as I tried to add a button widget, it stopped working. The list would expand on first click, showing my hidden TextView and Button, but it will not disappear on further clicks. The button is however, clickable, and I was able to set up an onClick listener to change the button text back and forth.I'm starting to wonder, is it just not possible to have a clickable item inside a clickable list item? Or is there some kind of work around? Would it solve my problem if I used ExpandableListView?

View 1 Replies View Related

Android :: How To Persist Options Selected In AlertDialog Spawned From ItemizedOverlay OnTap Method

Jun 7, 2010

In the description of how to add a list of options to an AlertDialog the official Android documentation alludes to saving a users preferences with one of the "data storage techniques." The examples assume the AlertDialog has been spawned within an Activity class.

In my case I've created a class that extends ItemizedOverlay. This class overrides the onTap method and uses an AlertDialog to prompt the user to make a multi-choice selection. I would like to capture and persist the selections for each OverlayItem they tap on.

The below code is the onTap method I've written. It functions as written but doesn't yet do what I'd hope. I'd like to capture and persist each selection made by the user to be used later. How do I do that? Is using an AlertDialog in this manner a good idea? Are there better options?

CODE:.......................

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved