Android :: MapView With ItemizedOverlay Still Don't Work / Solve It?
Sep 7, 2009I've try to make a mapview with itemized overlay and it's not work. I share my code if anyone see anything :
java class mapview code...
I've try to make a mapview with itemized overlay and it's not work. I share my code if anyone see anything :
java class mapview code...
I am developing an application for the Parisian Metro. One of the functions is a map where you can click the metro stations and see what are the metro lines, and when are the next 4 trains on this station.
I have hence created a MapActivity and an ItemizedOverlay classes.
On my device it is working perfectly, but I am getting some logs from the users with a crash, and I really don't understand what's wrong.
My map activity adds ONE ItemizedOverlay that displays a blue dot for the current user location. This overlay also listens to onTap, which depending on the coordinates of the tap, will try to find metro stations (for which I know the lat/lon coordinates). This is working perfectly.
The stack trace of the crash is:
CODE:.....................
Sometimes it comes from different lines but it always finishes crashing at OverlayBunde.java:42
As is does not mention my code, I don't know what's wrong.
You can get the source code of the MapActivity and the the ItemizedOverlay: http://code.google.com/p/metroparis/source/browse/trunk/src/org/bicou/metro/
The activity class is ACarteStations and the overlay class is StationMetroMapOverlay.
In my application I would like to mark different spots on a map. What I'm now wondering is if there's a way to use a simple 9-patch image and add the spot's name as text to it or would I need to draw everything myself (including the text) in the draw() method of ItemizedOverlay?
View 1 Replies View RelatedI have been trying to get this seemingly simple problem fixed for about half a day now. I have a working MapView and I just want to show the default zoom keys and have them there all the time. They do not appear at all - it's not that they appear then go away.
Code...
I have tried commenting out the setZoom and tried moving the setBuiltInZoom controls to the updateLocation method. I've found a lot of posts in relation to this problem but none that solve it.
I have a MapView (in MapActivity), and it works in my simulator.
The google map and the overlay I made are showed in simulator screen
After installing in HTC Hero, the overlay is showed in phone screen, but google map is not showed in phone screen.
I've had the Sprint HTC Hero since Nov 25. 2009 and my vibrate has never worked. I just recently realized it when I used someone else's Hero. I have all the settings to vibrate but it just seems like nothing works. Any idea?
View 1 Replies View RelatedI am facing to android application signing problem. My application contains Google MapView. When I compile the app and run on the emulator, MapView works fine. But signed the app, MapView doesn't work. I've get Google Map API. This works on the simulator. I could sign the app once 2 months ago. Then I've upgraded the app. Now I need to sign the app again. Actually I don't know why signed app's mapView doesn't work. How to fix it?
I used following steps when sign the app: Run Eclipse. Select the project. Right Click -> Android Tools -> Export Signed Application Package -> Then Filled forms. (In forms, Validity years: 200, and all passwords are same.)
Found out why I can't connect to our work server.
Corporate does not run Active sync
**Touchdown Made this Work!**
i used this tutorial to make a map activity: https:[url].....
The map and my overlays show up fine. But when i try to pan to somewhere on the map, my touch controls start acting funny. The map pans to the ocean or another country altogether. Or it zooms out all the way and sometimes it opens other apps when i try to pan.
Any suggestions on how to get it to work? it used to before i switched to the newest leaked 2.2 rom (8/26 or 27 i think) with the bloatware already uninstalled.
View 25 Replies View RelatedI had found a lot of stackoverflow post about save an Activity and the reload it.
My question: How can I have an Activity with an MapView and after reload the same mapview?
What is the best way to switch between activity and views?
Is it possible to use "stretchable" graphic as pin in ItemizedOverlay? If not how can I draw NinePatchDrawable on Canvas?
View 4 Replies View RelatedI've seen all the posts about using setLastFocusedIndex(-1).
I've tried that but my app is still crashing.
CODE:...............
This does not refer to anywhere in my code at all.
How do I go about getting to the bottom of it?
CODE:..........................
Here is the draw method of the ItemizedOverlay
CODE:..........................
I now print out the stacktrace and no difference!
I want to draw 20 pins on a MapActivity. Each pin has a small pin image, but I have to dynamically overlay a small bit of text over each pin at runtime.
Looks like I have two options:
#1) Itemized Overlay This is the suggested method. I put all my pins in one ItemizedOverlay object, and that counts as a single Overlay object for my MapView.
#2) One Overlay per pin Create a separate Overlay instance for each pin I need to render.
The problem I see with using method #1 is that you need to set a drawable for the item. This would mean that I need to create 20+20 (one for focused/non-focused state each) bitmaps and keep them in memory for the duration of my app. On the other hand, Overlay lets you override the draw method so I can do the simple compositing at runtime.
The other issue with Itemized Overlay - although it handles focus for you - does it move the focused item to the front of the z-order when selected?
I'm having some troubles with displaying ItemizedOverlay(s) on a map.
Here I extracted a simplified example of what I need to do.
Here's my Map class:
CDE:........
I followed the guide provided by google to extends the ItemizedOverlay class
CODE:...................
As it is clear from the code I need to update at fixed times a map UI with possibly new positions to do so I'm using a timer, but I think I might fall in some kind of thread issues I don't know how to handle, since when running a test I can see in the Log what happens but no marker is drawn on the map.
I have an itemizedOverlay extended and I want to increase the hit detection on the OverLayItem's if this is possible?
View 1 Replies View RelatedI'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.
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).
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.
I have a method in my ItemizedOverlay class which takes an object as a parameter and depending on it's certain values returns an appropriate icon. What's the best way to access the drawable resource from within ItemizedOverlay as you can't access it directly like in an activity? The only idea I have for now is to pass the resources as a second argument...
View 3 Replies View RelatedI have the following exception that occurs I don't really know in which circumstances.
I'm just trying to add an overlay to may viewMap, and I don't have anything special in my classes. The most strange thing is that it worked for a while, then it broken again when I changed my image!
CODE:............................
I am trying to display one png (drawable) on a map in about 300 points. I am retrieving the coordinates from a Sqlite table, dumping them in a cursor. When I try to display them by parsing through the cursor, it takes for ever for the images to be drawn, about .5 second per image. I find that to be suspiciously slow, so some insight on how I can increase performance would help. Here is the snippet of my code that does the rendering:
while (!mFlavorsCursor.isAfterLast())
{
Log.d("cursor",""+(i++));
point = new GeoPoint(
(int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LATITUDE))*1000000),
(int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LONGITUDE))*1000000));
overlayitem = new OverlayItem(point, "", "");
itemizedoverlay.addOverlay(overlayitem);
itemizedoverlay.doPopulate();
mFlavorsCursor.moveToNext();
}
mapOverlays.add(itemizedoverlay);
I tried to isolate all the steps and it looks like the slow one is this: itemizedoverlay.doPopulate(); This is a public method in my class that extends ItemizedOverlay that runs the private populate() method.
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:.......................
I have a moto android w 2.1. The gmail app has been working fine until recently. Now it says no connection when I open the program. It shows two recent emails but no previous ones. I cannot send or receive anything w the app. My browser gmail is working properly. One user on the google support forum got no solutions from verizon, google, or motorola and had to do a hard reset. It appeared to fix the problem but I'm looking for a more friendly solution. Anyone else have this problem or have guess as to the solution?
View 1 Replies View RelatedI am able to deploy my application but for some reason, I am not able to get the icon to display in the pull up menu on the Home page of the OS. Does anyone know what I can do to solve this?
By the way, the application shows up in "Manage Applications" but does not show up as an icon for some reason. Through Eclipse, I am able to start the application after deployment but that's it... After that, I don't have any way to start it because there is no icon.code...
I have a small application. It has some user inputs (like name, phone number, country, connection type etc, I used editText for the user to enter). Its working fine on the emulator. When I installed the same app on real device, firstly it shows the whole input screen. But when I tried to give input, (changing into landscape mode) half of the screen is not visibiling. I want to show the whole screen, I dont know how to do?
View 7 Replies View RelatedI use the setBuiltInZoomControls to setup Zoom in my app, in the emulator, i can use mouse to click the zoom in/out, but when the app install in my machine, i can't use mouse to click, but still work by touch! did somebody know how to solve that?
View 6 Replies View RelatedThis is the error that eclipse gives with the latest Android SDK code...
Linux myubuntu 2.6.28-16-generic #55-Ubuntu SMP Tue Oct 20 19:48:24 UTC 2009 i686 GNU/Linux
java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
Any clues on how to solve this error?
In my application if i press a button map is loaded in my layout.again i press the button i got error like this.
only one map is added to a single map activity . how to solve this.