Android :: Overlays Not Working In Google MapView Tutorial Android
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
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
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
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
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
Jun 4, 2009
I'm following this tutorial here: http://developer.android.com/guide/tutorials/views/hello-mapview.html
and am on point 11
Here's the res/layout/main.xml:
CODE:........
Here's the code:
CODE:........................
View 2 Replies
View Related
Jan 17, 2010
I'm been trying to get to grips with Android and have been writing some simple apps and working through the tutorials. I'm having trouble with the MapView tutorial, lets start with the code which is: package
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
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
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
Nov 13, 2010
I'm on Mac OS X Leopard and installed the ADT plugin into Eclipse Galileo. I followed all these steps to get started:
http://developer.android.com/sdk/index.html
My SDK version is 2.2 API 8 revision 2 and I just used the Hello World tutorial found here:
[url]
When I first created the Android application, I saw this error in the Eclipse console:
[2010-11-13 18:20:43 - HelloAndroid] ERROR: Unable to open class file / Users/mydirectory/Documents/workspace/HelloAndroid/gen/com/example/ helloandroid/R.java: No such file or directory
I commented out this line to fill in the few lines from the tutorial:
setContentView(R.layout.main);
When I ran the app, it launched my emulator but all I saw was a vertical screen on the left that said "ANDROID" and phone buttons on the right. I did not see the "Hello, Android" text from the tutorial.
View 2 Replies
View Related
Sep 21, 2010
I have followed the tutorial and can't seem to get it to work.
Here's my code:
CODE:...........
All I get are error message everywhere. What did I do wrong?
I followed everything the tutorial said to do.
View 1 Replies
View Related
Jun 29, 2010
I'm having trouble getting my app to work properly on older devices. I've ready the "Backward Compatibility" tutorial, I'm working for performance - and it suggestions using .invoke is considerably slower than using a wrapper class. But it seems the wrapper class only works for if a class is not available on older devices. I'm compiling with 2.2, but minSDK is 1.5. I'm working with multitouch, I assumed that if I checked against Build.Version.SDK, and didn't call getPointerCount() - then it wouldn't raise an error. But when I create an instance of the class which has my methods in, I get this: 06-29 08:17:28.263: ERROR/dalvikvm(255): Could not find method android.view.MotionEvent.getPointerCount, referenced from method com.myPackage.myClass. Despite not actually calling it. Is this normal?
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
Aug 29, 2010
'I tried to open the tutorial programed to the phone and i can't get past the "begin" button. It says to click and nothing happens, i don't get to another screen by now i don't really need the tutorial but i am still bothered that it doesn't even work .
View 3 Replies
View Related
Jun 2, 2010
I 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.)
View 2 Replies
View Related
Jan 30, 2009
Now, I'm developing an Android app called "Echo". But 5 hours ago, My Dev phone haven't displayed MapView. First, I supposed that my API-key have been disabled. I tried to Maps API Key signup agian. But google server response error.
> Server Error > The server encountered a temporary error and could not complete your request.
> Please try again in 30 seconds.
View 4 Replies
View Related
Apr 19, 2010
I don't know how to create an custom Activity extending MapActivity and ListActivity ?
I am trying screen that contains of google map and list view.
How to make it?
View 1 Replies
View Related
Aug 31, 2010
Just wondering if there is a standard/default overlay/marker that I can use in the MAPVIEW?
I have been searching on the web and all tutorials talk about extending the Overlay and put your custom image on it.
Is there a easier way? I just want to have the a marker, nothing fancy.
View 1 Replies
View Related
Aug 31, 2010
When I view the following xml file in the layout view (eclispse), I got NullPointerException:null message, but when I run the code, it works.
CODE:..............
View 1 Replies
View Related
Jul 20, 2010
I have a mapview where I want to track the user's current location. GPS as well as 'use wireless networks' is activated in my phone settings.
Nevertheless, since I'm indoor I don't get a GPS fix, therefore the location is determined via network; wifi spot is available.
I have the Google Maps app running as well as my application running.
Strangely, the current location differes between Google Maps and my application, where the Google Maps is very accurate while in my app the location is somehow off a few 100 meters.
In my application I basically do the following (for debugging purposes now):
1) initially place one marker on the map: geopoint retrieved via locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
2) initially place another marker on the map: geopoint retrieved via locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
This will put the last known locations of both providers onto the map (eventually last known from outside my app).
3) then for the regular updates (since I don't get a GPS fix anyway indoor here), I do:
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, baseLocationListener);
You can see for the frequency and distance I pass the 0 param in both cases.
In the app manifest, the following permissions are granted:
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_MOCK_LOCATION
Actually my baseLocationListener does get called, which I see in the log, but the updated location is somehow the same as the last known current position (of LocationManager.NETWORK_PROVIDER), same lat/lng.
I thought maybe I overlooked something or missed a parameter or setting, or my code has a bug. Therefore I installed some other (3 in total) LBS apps from the Android market that also show the current user's location. The current locations displayed in those apps are equals to the one in my application - and they're all some 100 meters off - but at least all the same.
See the screenshot here:
http://img33.imageshack.us/img33/8679/mapproblem.png
Now I am wondering:
1) as I understand, getLastKnowLocation is system-wide and not app-wide, why are there differences between the location in Google maps and all the other apps?
2) does Google Maps not update the lastKnownLocation of a provider?
3) does Google Maps use a different custom location provider (i.e. due to licensing reasons) other than GPS_PROVIDER or NETWORK_PROVIDER as they are in the SDK?
4) how do achieve the same accurate result with the NETWORK_PROVIDER like Google Maps does?
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