This is the code where I add the map to instabug:
Log.i("","entered here... map:" + mMap + "...." + mMapFragment.getView());
PSLocationCenter.getInstance().instabug.addMapView(mMapFragment.getView(), mMap);
Where I get this log:
04-01 14:28:55.455: I/(26117): entered here... map:com.google.android.gms.maps.GoogleMap#5091193....android.widget.FrameLayout{7dbac34 V.E...C.. .......D 0,0-1080,1776}
As you can see. my map exists, and also the fragment. The initMap function is in the BaseActivity, and other classes to have the map inside instabug.
This is my map:
And this is what I see in instabug:
In Instabug we hold WeakReference<GoogleMap> so can you try switching the GoogleMap variable to a global variable in your class and tell me how it goes?
I've also noticed you're using v1+ of Instabug, I'd recommend using v2 as it contains a lot of bug fixes and enhancements aside from the UI rehall and the new features :)
And please don't hesitate to contact us on our support channels through the website anytime.
This issue has been solved since version 3.0.0.
You just need to upgrade to latest version >= v3.0.5
Related
Using the newest version of the MPAndroidChart. Android Studio 3.6, sdk 29.
Legend legend = lineChart.getLegend();
legend.setPosition() // this is red, no such method. obviously would have a LegendPosition in it
Every other method for Legend works, just not setPosition. What am I doing wrong?
I found one user saying it was deprecated but he links to a thread from 2016, and .setPosition is in the wiki updated in Nov 2018, so I'm not sure if that's the case or not.
Edit: Using the method described by that user, I was able to get the same effect. Still curious about the state of .setPosition(), is it deprecated?
legend.setPosition is deprecated.
you should use below piece code
legend.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
legend.setOrientation(Legend.LegendOrientation.HORIZONTAL);
legend.setDrawInside(false);
It is not possible to invoke Instabug on other Activities than the one we use the MapView for once Googles MapView has been added.
Setting up Instabug looks like this:
if (BuildConfig.DEBUG)
{
new Instabug.Builder(this, "TOKEN")
.setInvocationEvent(IBGInvocationEvent.IBGInvocationEventShake)
.setDefaultInvocationMode(IBGInvocationMode.IBGInvocationModeBugReporter)
.build();
}
and the MapView once acquired:
Instabug.addMapView(view, googleMap);
Invoking Instabug with the MapView works perfectly fine. But invoking it on an other Activities won't work any longer and following logs get printed:
b: Registered Google MapView no longer exists. Skipping.
Screenshot capture failed: Top most activity changed before capturing screenshot
Screenshot capturing failed: Top most activity changed before capturing screenshot
Issue occurs on version 2.6.2
This issue has been solved since version 3.0.0 .
This issue should disappear, if you just upgrade to latest version >= v3.0.5
I think that it is a really noob question but i could not do it.
In new Google maps API for Android (v2) you can get you location right now touching the new button that appears on the map when you code:
myMap.setMyLocationEnabled(true);
That's works fine but I want to "catch" the event when the user touch this button because i want to add more actions and I don't know how to reference that button in code.
Anyone knows?
Thanks in advance.
GoogleMap.OnMyLocationButtonClickListener was just announced. probably going to be released today in the next Google APIs version.
This is not currently possible via the api.
A feature request is already pending and I think this will be added soon.
See this: http://code.google.com/p/gmaps-api-issues/issues/detail?id=4789
Oh yes, sorry. I should have read your question more clearly.
In order to your question:
In those situations, I recommened that you layout out your own my-location-button on the mapView and add a clicklistener on that and over location-listener, you can get the current position.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom));
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.
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)