Android :: Overlays On A Mapview Not Shown
Mar 1, 2010
I followed the instructions from the google hellomapview tutorial. I get a working mapview etc. But the two items that are added to the map are not shown. It seems they are there somewhere because tapping at the specified location shows the message that was added to the items.
Here is my source code. It should be very close to the google tutorial source code.
CODE:.............
View 2 Replies
Sep 28, 2009
My problem is my MapView becoming very laggy and so non-responsive at times, that Android thinks its hit deadlock and tries to close it.
I am adding 60 overlays to the map view and i originally thought that the icon size may be causing the problem by using up all the memory. When i decreased the overlay icon size, it did improve things, though it is still to slow to be usable. Has anyone experienced anything similar and have a workaround? There may be a better way of doing it other then extending the Hello MapView example.
View 8 Replies
View Related
Feb 14, 2010
i have a problem with my mapView. my app reads "some" gps points out of a file and i want to draw a route (drawing lines between the gps point). If my file contains many gps points, my app works really slow. i think its working slow, because i draw all overlays. now i want to check, whether a point is visible in my mapView or not. so i have to get the mapCenter and Lat/lon span (getLatitudeSpan,..) !? how and where must i save my points and how can i check all my points (after my mapCenter has changed for example). Shall I save my points in a list (in my Overlay class??) and iterate through every list item and check, wheter its visible or not?
View 4 Replies
View Related
Oct 29, 2009
I've been reading the (shoddy) documentation for the Google Maps API (MapActivity et al), and I think I have roughly worked out how it works. It seems that if you want to add a marker overlay you can use ItemizedOverlay easily, but you have to add all your markers at once. There doesn't seem to be any way to remove them.
What I want to do is query markers from an online database as the user pans around (in the same way the actual map tiles are fetched). Is there a simple way to do this?
As far as I can tell I need to subclass Overlay and implement the draw method, but where is the best place to put the code that fetches new markers when the map is panned? There doesn't seem to be an onMapChanged() method anywhere. My best guess is MapController.onKey() but that seems wrong.
View 2 Replies
View Related
Feb 17, 2010
I'm seeing a bug with overlays on MapView with the Nexus One. Pinch and zoom multitouch gestures don't scale my overlays until the user releases the gesture, at which point the overlay redraws itself. In contrast, the My Location overlay in Google Maps WILL scale during the gesture. Is there a way to fix this in my app, or is this a MapView bug?
View 2 Replies
View Related
Oct 1, 2010
The Android the MapView Overlay class mentions two draw methods. One regular, and one for animated overlays.
I have tried to find more information on how to animate overlays and use this second method, but it all keeps coming back to the same forum postings. Can anyone explain how you specify to the MapView that a certain Overlay should be animated? How do you specify the manner in which it animates?
If it's relevant, I'm currently trying to draw pins in the map that update in realtime with streaming GPS locations for objects. I get new data every two seconds and need to tween the locations by having the pins move in a simple straight line between coordinates.
View 1 Replies
View Related
Oct 9, 2009
When an overlay is put on a MapView, the shadow suggest that its at an angle and not flat on the map.
I have been creating scaled bitmaps to overlay on a mapview, but i am either geting the scale wrong or the overlay is being painted at a slight angle, sitting up a bit, rather then being flat to the map.
Does anyone know if this is true? and if so, is there a way to stop it painting at an angle or do you know the angle so i can compensate for it when creating the bitmapped overlay?
View 2 Replies
View Related
Dec 30, 2009
I've been searching for this for quite a while and never come across a way to do it. In the Google Maps App, when you search for directions, there are overlays with buttons in them, and I want a similar thing, a marker with an image, text and button inside.
I've implement ItemizedOverlays before and made the marker clickable which I would event be happy with if I could put a linear layout inside the marker to organise the image and text since they are different for each marker.
View 3 Replies
View Related
Oct 27, 2010
I have a mapview and i wish to display a ContextMenu when longclick but so far the closest solution i've found is here on anddev , the main reason i do not like that method is because any click activate the ContextMenu instead of a long click.
Question: Is there a way to display the ContextMenu of a Map without using Overlays? Why?
View 3 Replies
View Related
Oct 26, 2010
If a user does a "pinch zoom" on the map, my overlays don't properly size until the end. This has been noted in other posts, so i assume it is a known issue.
Problem is, my client finds it totally unacceptable, as I am tasked with making the android app look as good as the iphone version.
Is there any way to correct this, even if it is a horrible hack? For instance, can I subclass the mapview and handle drawing or override some other method?
View 1 Replies
View Related
Feb 16, 2010
Got some errors following the tutorial for MapView when i was going to integrate overlays.
CODE:..............
I am trying to learn and i got an awesome app idea which needs mapview, webview, overlays and tabs.
View 1 Replies
View Related
Sep 23, 2010
I've searched here and on the interweb, but cannot find out how to add overlays (.kml files) into Maps or Earth. Can it even be done (shame if not) and if so, how do I do it.
EDIT: I've tried MyMapsEditor, but that doesn't run on Froyo.
View 2 Replies
View Related
Jul 16, 2010
I 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?
View 2 Replies
View Related
Jul 17, 2010
What I am trying to do - I am continuously getting a stream of lat/lng positions, I want to move a overlay item dynamically on the map based on the lat/lng in the stream. I am displaying the location of moving object dynamically on the map
I am putting my whole code in a while(true) loop and trying to read the stream every 5 seconds and refresh the overlays on the map. But overlay items are not shown until the function (either oncreate, or any onclickeventhandler etc) is completed. For example, test code, I am adding a single test overlay item when ever the user clicks on a button. If I put a wait(2000000) "after" I add overlays and invalidate the map, the overlay is not displayed until the time has elapsed and the function is completed.
View 5 Replies
View Related
Nov 2, 2009
In my app I am drawing bus routes on top of a MapView. The routes have anywhere between a dozen and a few hundred GPS coordinates that describe the route that the bus takes. The problem I'm having is that once I draw out all these lines panning/zooming the MapView is incredibly slow (even clicking the 'Back' button takes a minute to happen). I'm not sure how relevant it is, but I put in some debug code then checked the logcat output and the MapView is repeatedly calling the draw() method of the Overlay whether anything has changed or not. This is happening several times a second and is causing a massive amount of garbage collection to happen (2-3 MB every second).
View 2 Replies
View Related
Sep 12, 2010
I have the following code to add an Overlay
myMapView.getOverlays().add(sites);
myMapView.invalidate();
I also have the following remove code where sites is a global variable.code...
Sometimes I am left with duplicates so would like a way to remove all overlays from a map, is this possible?
View 1 Replies
View Related
Nov 24, 2010
I want to do the following and am kind of stuck on these for a few days:
1) I was trying to draw poly lines ( I have encoded polylines, but have managed to decoded those) that move when I move the map(the only solution that I found was for Geopoints to be transformed into screen co-ordinateswhich wont move if I move the map !)
2) I have used helloItemizedOverlay to add about 150 markers and it gets very very slow.any idea what to do ? I was thinking about threads(handler)
3) I was looking for some sort of a timer function that executes a given function, say, every 1 minute or so.
4) I was also looking for ways to clear the Google map from all the markers/lines etc
View 1 Replies
View Related
Apr 17, 2010
I have a map in my android application that shows many markers (~20-50). But the app performs very poor when i try to scroll/zoom (in Google Android Maps i did a sample search for pizza and there were also some 20-50 results found and i didn't notice any particular performance problems when zooming/scrolling through the map).
onCreate() {
....
drawable = this.getResources().getDrawable(R.drawable.marker1);
itemizedOverlay = new MyItemizedOverlay(drawable,mapView);
...
callWebServiceToRetrieveData();
createMarkers();
}..............................
View 4 Replies
View Related
Apr 14, 2010
I have a ImageView and draw some things on that view. Now I want to have the position of the click in the onClickListener. Although I think that's not really possible (storing the position in the onTouchListener is not working), I want to ask, if there is any other way to accomplish that? The goal is to have a image with some overlays, that should be clickable. I thought about AbsolutLayout, but that is depracated, so what now?
View 1 Replies
View Related
Nov 15, 2010
I've got a game, a custom View class draws my gameboard. I'm thinking of drawing some elements on a separate layer above the gameboard. I could do this in the View's canvas code, but since they won't change frequently, was thinking of introducing a frame layout to display this top layer.I'm not sure which route to take, the only reason I wouldn't do the FrameLayout is because I'm not sure if it has an impact on battery life. Everytime onDraw() is called, the system probably has to do an alpha composition of the two layers. Is that more battery consuming than drawing the elements from that layer myself in my canvas on every frame? Hard to answer since I'm not sure how complex the drawing will be yet, any general opinions?
View 1 Replies
View Related
Mar 31, 2010
I want to clear all map overlays or markers from google map and using following code
if(!mapOverlays.isEmpty())
{
mapOverlays.clear();
}
which is giving me exception can any one guide me? am i right or wrong if i am wrong then kindly provide me the solution to my problem. i want map clean if there is any marker on it.
View 2 Replies
View Related
Oct 21, 2010
Can somebody point me to the right direction how the navigation overlays for My Tracks are implemented? I'm talking about the "buttons" for navigating appearing on the left and right side if you tap on the screen. Any pointers?
View 3 Replies
View Related
Jan 20, 2009
This is odd. I need to make my code pretty, so the first thing I want to do is to change the all the strings 'com.appspot.lbtdl' to 'com.faberfedor.tagyourworld'. I change every string in all the directories using the Perl 'pie' technique. Then I put the code into a new directory, create a new Eclipse project and run it. Code...
View 13 Replies
View Related
Apr 22, 2010
I'm trying to write code that draws accuracy circles around a gps location based on a time param. I have no problem setting up the GPS, or of calculating how to draw the circles.What's been killing me is that the Overlays always overwrite one another.So I can never have more than one circle.I've looked at all the examples and tutorials online but they seem to be obsessed with putting in icons or with Drawing from some database or array.If I understood correctly I should be able to do itemizedoverlays and just draw as i go without having to track each readout in an array.
View 9 Replies
View Related
May 7, 2010
I'm trying to create a dynamic ItemizedOverylay (please see the code below) on Google Maps (Android 2.1) on a Nexus One. In my Activity (that extends MapActivity) I'm creating a data thread that is receiving data from the network. A 'handler' is used to communicate the data from the receiving thread to map activity. This data contains the locations (lat, lon) of the markers that I want to overlay on my map. The location of each marker is dynamic (i.e., it changes every time I receive new data from the network.) refreshItems(ArrayList<OverlayItem> newItems) method in invoked inside the handleMessage() of the handler. There are around 11 markers in the ArrayList that is passed to refreshItems
I can see the markers overlayed on the map. However, I've two issues:.....................
View 1 Replies
View Related
Sep 20, 2010
i am showing list of map overlays on google map using following code
mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(R.drawable.balloon);
itemizedOverlay = new MarkerItemizedOverlay(drawable,this);
GeoPoint point;
OverlayItem overlayitem;
for (DalMapSearch t : Sr)
{
if(t != null)
{
point = new GeoPoint((int) (t.getLati() * 1E6), (int) (t.getLongi() * 1E6));
overlayitem = new OverlayItem(point, heading, t.getAd_text()+", "+t.getLocation()+"@@"+t.getAd_id());...................
so in such a scenario balloon is displayed i want to show other images too depened upon category or a if statement. any one guide me how can i show different images as a map overlay? for example images are imageA,ImageB,ImageC
View 1 Replies
View Related
Aug 16, 2010
What can I do with the "shadow layer" of the the google maps overlays? I tried, naively, to draw something (an arc) only when (shadow == true) and got nothing? I'm interested in drawing arcs and arc shadows on a map. is there a nice google-maps way to do this?
View 5 Replies
View Related
Apr 29, 2010
For any Android project that I create using Eclipse, I cannot see the preview of the XML layout that I define. It gives a message saying "Eclipse is loading framework information and Layout library from the SDK folder. XXX.xml will refresh automatically once the process is finished."
View 2 Replies
View Related
Aug 5, 2010
1/I don't want to notify user if this one is already running my app in foreground,is it possible before create nofification to check if my app is not in front? 2/if app is in background, is it possible to bring last state in front? I know that Os can destroy some Activity, but is it possible to restore last state, don't start a new Intent? because if i start a new Intent and i push back, old Intent appear it's not very beautiful to have 2 identical intent launch...............
View 2 Replies
View Related
Mar 21, 2010
I published several free and paid app in the Market. I recently get several complains from customers about not finding my app in the 2.1 Market. Even if they have bought them before, they can't find it in the market or their download list after updating to 2.1.
View 3 Replies
View Related