MapView rendering with tiles missing with an "x" in the center - android

This is very, very strange. I've never seen anything like it. At the time I am took this screenshot, I'm not loading any overlays. First, I thought it was my internet connection where it couldn't download the tile information; but we have many users reporting the same issue who downloaded from the market. This just started happening like a week ago. Not sure why though. Anyone have a clue? Thanks!

Ok. After starting from a clean project I found these two lines of code that was the culprit.
mapView.setSatellite(true);
mapView.setStreetView(true);
They appeared back to back of each other and I looked back at the very beginning of development and they were there and it worked just fine. Apparently, this is a BUG in the MapView as I'm guessing it tries to show both SateliteView and StreetView at the same time. One would think that the latter would override the former; but I guess not.
So, the question I have is, why this all of the sudden surfaced just within the last week or so. My guess is that the Maps Application was last updated in the market on Sept 8th and maybe a day or so after updating from the market, this issue started to resurface.
As a test, can someone just add these two lines to their code and confirm you get the same behavior?

I had only setStreetView(true) and getting those annoying grey boxes. I played around with both lines with no luck. Solved it by removing both setStreeView and setSatellite from my code, goes to streetview by default.

I had the same problem with my app that uses google maps library... Because i have in my setting option where user can change view of the map to Satelite or Street, i dont use setStreetView(true) at all...just mapView.setSatelite(true or false)...
preferences = PreferenceManager.getDefaultSharedPreferences(this);
pogled = preferences.getString("list", "Street");
if(pogled.equalsIgnoreCase("Street")){
mapView.setSatellite(false);
//mapView.setStreetView(true);
}else if (pogled.equalsIgnoreCase("Satelite")) {
mapView.setSatellite(true);
}
As you can see i had mapView.setStreetView(true) but that gave me a headache... :D I hope this will help you...

I removed setStreetview(true) from my code and now its working fine i was saw this issue occured in last 2 weeks , nyway we finally solved the issue thats great

Street view is always considered as the default option.
The problem arises when we use both setStreetView(true) and setSatellite(true) at the same time. Problem will be solved like this
if(mapView.isSatellite()){
mapView.setSatellite(false);
}else{
mapView.setStreetView(false);
mapView.setSatellite(true);
}
I hope that will help

private void setUpMapTypeScreen() {
if (mapType.equalsIgnoreCase("Satellite")) {
mapView.setSatellite(true);
// mapView.setStreetView(false);
} else if (mapType.equalsIgnoreCase("StreetView")) {
mapView.setSatellite(false);
// mapView.setStreetView(true);
}
mapView.invalidate();
}
mapType is a user defined string variable. Not false the previous view type when switching to view types. that the error we made, only set the view type you required.

I had the same problem, I took out my mapController, and it fixed it. The only other thing I did different was put the mapview in a linearlayout with a textview (it used to just be a mapview only) and I played around with the mapcontroller, commenting it out.
Since those are the only two things I changed, I'm pretty sure your problem lies in there as well.

I was having the same problem and the common advice that I have got is to not use setStreeView(true) and setSatellite(true) together. Some have even suggested not to use setStreetView(true) altogether. But my code was working okay before. I had to reinstall my machine and therefore installed android SDK and other components afresh after which this started happening. So my guess is that this is an issue with some specific version But I have found out that this problem occurs specific revision of 2.2 - in my case Android SDK Platform 2.2, revision 3. I have tried running same code on 2.3 and it works correctly i.e no grey boxes.

Besides removing mapController.setStreetView(true), there is also another thing that should be added to the layout XML..
xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mapa"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="YOUR API KEY"
android:clickable="true"></com.google.android.maps.MapView>
Note the xml namespace after com.google.android.maps.MapView. After adding the namespace, the cross tiles disappeared. Don't know if it's a bug or the namespace is necessary in order for the api render the map correctly. Either way, it worked.

Related

play-games-plugin-for-unity - show specific Leaderboard

I'm trying to integrate the google play Leaderboard with help of the play-games-plugin-for-unity plugin into my game.
It works fine, committing to Leaderboard an all, only one thing is not working. When I call the Leaderboard
//LEADERBOARD
if (GUI.Button(leaderboardButton, "Leaderboard"))
{
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(Constants.LEADERBOARDID);
// Social.ShowLeaderboardUI();
}
it opens the window where I see all leaderboards. But I'm giving a specific id. This would be the behaviour I expect from the line Social.ShowLeaderboardUI(); which is commented out. The overload with a given Id (hid behind Constants.LEADERBOARDID) should start the specific Leaderboard UI according to the doc. Someone knows if this is an issue (haven't seen any report on GitHub) and how to solve it? It isn't that that big of an issue, but one click is better than two.
I tried something interesting. I changed the Id to some wrong value. Still the same behavior (opening the window with all leaderboards). Of course committing the score doesn't work anymore.
Okay, i found the error in the sourcecode of the Plugin, fixed it and resolved the problem. So here I present the fix if someone needs it. It's in the LeaderboardManager class.
This is how ShowUI is called:
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowAllUI(mServices.AsHandle(), Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
This should be the correct version
internal void ShowUI(string leaderboardId, Action callback) {
Misc.CheckNotNull(callback);
C.LeaderboardManager_ShowUI(mServices.AsHandle(),leaderboardId, Callbacks.InternalShowUICallback,
Callbacks.ToIntPtr(callback));
}
}
See the difference? C.LeaderboardManager_ShowAllUI instead of C.LeaderboardManager_ShowUI is called.

BubblePopupHelper filling Android Debug Log

So I noticed when I was debugging that there seems to be a tag that's repeating through my app entitled "BubblePopupHelper" with text: "isShowingBubblePopup : false"
Screenshot of the log
To my knowledge, I'm not using or causing it. Does anyone have an idea of what's going on? The application is the one I'm writing.
Upon further inspection, I did notice that every time I'm updating text (via a TextView) it displays onscreen. If there's a better way of doing so, please let me know.
Thanks!
The message seems to be logged by some SDK libraries whenever setText is called in a TextView. I get it in Android Studio developing with min API 14.
One interim solution till Google removes it would be using the filtering feature of Android Studio by writing a RegEx that only includes your log messages. For example if I have all my tags start with 'Braim' then 'Braim.*' can be used
If you want to filter this annoying logs away you can use the following regex:
by Log Tag: (?!^BubblePopupHelper)(^.*$)
Have you added "OnGlobalLayoutListener"?
I've encountered same problem and finally I found that getViewTreeObserver().addOnGlobalLayoutListener caused the problem.
Here is my solution:
textView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
#Override
public void onGlobalLayout() {
...
textCategory.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
});

Appcelerator titanium - MapView on android causes app crash

am trying to display a map on android emulator, using the following code:
var window = Ti.UI.createWindow();
window.open();
var mapView = Ti.Map.createView({
mapType: Ti.Map.STANDARD_TYPE,
region:{
latitude:33.74511, longitude:-84.38993,
latitudeDelta:0.5, longitudeDelta:0.5
},
animate:true,
regionFit:true,
userLocation:true
});
window.add(mapView);
alert(mapView)//outputs Ti.Map.View
I have made all the steps mentioned here http://wiki.appcelerator.org/display/guides/Maps+for+Android
but the application crashes. Does anyone has an idea what might be causing this?
thank you
Without a stacktrace of your crash I can only guess it's caused by an emulator which does not provide the Google Maps API. See http://developer.appcelerator.com/question/121105/crash-in-android-when-using-maps
try removing the your key here from the tiapp.xml file then refreshing the android emulator and it will work but resets to the empty google interface anybody got any ideas
You may have created other Map views elsewhere in your code.In that event,Google doesnt allow that and you end up with a force close (IllegalStateException)

Android Google Maps Activity only shows small crosses

I currently have a Google Map Activity which is apparently working well but doesn't show the map (this sounds stupid!)
Here is a picture that will make you understand better my problem:
I already confirmed my apiKey, checked the tutorial over and over and even the manifest seems not be missing anything.
I get only this on adb:
276 MapActivity W Recycling dispatcher
com.google.googlenav.datarequest.DataRequestDispatcher#43ea39b0
276 MapActivity V Recycling map object.
51 GpsLocationProvider D setMinTime 1000
276 MapActivity I Handling network change notification:CONNECTED
276 MapActivity E Couldn't get connection factory client
Does anyone have a clue about what may be causing this?
Thanks.
Are you running the app signed with your key from your key store, or the debug key (clicking run in eclipse will sign the apk with a debug key and install it on the device - be it the emulator or a physical device).
If you have a map key (apikey), the keystore will have two different hash codes depending on whether you use the debug key, or your key - so you need two different map keys depending how you are running the app (the debug one will only be needed when you are developing the app).
Take a look at the debug section: http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint
IF you are using setSatellite(boolean) and setStreetView(boolean) then you can face such situations. This is a BUG in Map View. Use only one of these two methods or you can try with some combinations of these two. Some times, use of only one of them solves the problem sometimes, you need to use a combination of both...like I did in my particular case..
streetView.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View view) {
mapView.invalidate();
mapView.setSatellite(false);
//mapView.setStreetView(true);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean("satelliteView", false);
}
});
satelliteView.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View view) {
mapView.invalidate();
mapView.setStreetView(false);
mapView.setSatellite(true);
}
});
Are you sure that you are properly setting the API key for the MapActivity/View?. Can you post your layout xml and source code?
Make sure to follow the steps from this tutorial: http://code.google.com/android/add-ons/google-apis/maps-overview.html
It will also show a map like that if it you send it a fake lat/lon pair where there is no useful map data, eg. "geo fix 0.0 0.0" (North Pole)
Try "geo fix -0.1 51.5" (over South London) where there is Google map data.
The problem was that the coordinate was wrong and that way the map was so zoomed that it wasn't able to show anything.
I zoomed out and I there was the map; so it was a coordinate problem and not a key/map activity problem.
For those who can't zoom out in these cases add this to your code
mapView.setBuiltInZoomControls(true);
and in the layout
android:clickable="true"

Android 2.1 fling gesture captured on textview but still a contextmenu opens

The following problem seems unique to 2.1, happens both on an emulator and on a nexus. The same example works fine on other platforms I've tested (1.5, 1.6 and 2.0 emulators).
I've added created gestureListener as described in this post.
The difference is that I've added the listener on a TextView which also has a contextMenu registered, i.e. sth like the following:
onCreate(...) {
...
// Layout contains a large TextView on which I want to add a context menu
tv = findViewById(R.id.text_view);
tv.registerForContextMenu(this);
// create the gestureListener according above mentioned post.
gestureListener = ...
// set the listener on the text-view
tv.setOnTouchListener(gestureListener);
...
}
When testing it, the correct gesture is recognized alright, but every other time it also causes the context menu to be opened.
As the same example is working on non 2.1 platforms, I've got a feeling it is not my code that is the problem...
Thankful for any suggestions.
Update:
Seems that the return value is flipped somewhere. If I let onFling() return the "wrong" value, i.e. true when the event is skipped and false when it was consumed, it works correctly in 2.1. But of course, that doesn't work on the other platforms. Seems like its time for an ugly workaround...
Thanks for the link steelbytes. I implemented the cancel-and-return-false solution in the last comment (Dec 27, 2010) but just for my onFling event and it appears to work on 1.6 as well as 2.x devices.

Categories

Resources