Community
Topic: Xamarin component
Camera / Markers not visible (SOLVED)
Hello,
we are using Pikkart Xamarin Component 3.0.0-rc6 with Android 7.0 with the GeoActivity.
The camera view is not visible because it is hidden behind Google Maps view.
If we remove the Google Maps view with this hacky code then the camera is visible:
var geoView = (ViewGroup)FindViewById(Resource.Id.activity_pikkart_geo_layout);
var viewGroup = (ViewGroup)geoView.GetChildAt(0);
if (viewGroup.ChildCount == 4)
{
viewGroup.RemoveViewAt(3);
}
What is the inteded UI for this? Google Maps with transparents to see through the camera view?
The markers on the camera view are not visible. But on the Google Map view they show up.
We already set the GeoElementVisibility to "OnAll" but the markers are not visible.
The GetView method on the MarkerViewAdapter is never called for the camera view.
Why are the markers not visible on the camera view?
Regards
Hi,
to show the camera the phone should be placed perpendicular to the ground, if the phone is kept parallel to the ground (as it is default on an emulator) the map is shown.
To display the camera, the phone must have the following sensors:
- gyroscope
- accelerometer
- gravity
- magnetometer
If your phone does not have one of these sensors, the sdk only shows the map.
As for the display of the markers there seems to be a small bug in the rc6 version of the xamarin sdk.
As for the display of the markers there seems to be a small bug in the rc6 version of the xamarin sdk.
You can still view them using the MarkerViewAdapter, referring to the PikkartGeoTutorial project of the xamarin component in the init () method, you can use the example MarkerViewAdapter as follows:
MyMarkerViewAdapter arMyMarkerViewAdapter = new MyMarkerViewAdapter (this, 51, 73);
MyMarkerViewAdapter mapMyMarkerViewAdapter = new MyMarkerViewAdapter (this, 30, 43);
InitGeoFragment (arMyMarkerViewAdapter, mapMyMarkerViewAdapter);
// InitGeoFragment ();
And the MarkerViewAdapter can be like this to replicate the behavior of default or modified as you want
Private class MyMarkerViewAdapter: MarkerViewAdapter
{
Public MyMarkerViewAdapter (Context context, int width, int height): base (context, width, height)
{
IsDefaultMarker = true;
}
Public override View GetView (GeoElement p0)
{
ImageView imageView = (ImageView) MarkerView.FindViewById (Resource.Id.image);
imageView.SetImageResource (Resource.Drawable.map_marker_red);
imageView.Invalidate ();
Return MarkerView;
}
Public override View GetSelectedView (GeoElement p0)
{
ImageView imageView = (ImageView) MarkerView.FindViewById (Resource.Id.image);
imageView.SetImageResource (Resource.Drawable.map_marker_blue);
imageView.Invalidate ();
Return MarkerView;
}
}
Best,
Hi,
Thanks! I have used an older phone which did not have the required sensors.
With a newer phone it works great.
But it is strange that the camera view is running behind the google map even if the phone does not support it.
Regards
Hi team. I am having a message in italian "Non e possible vizzualizare la sezione. " only the map is displayed. does it mean i dont have the required sensors in my phone? ... I use about 5 phones and i have the same error...
Hi,
the error is displayed when the phone does not have one or more of the following sensors needed for geolocation in augmented reality:
- gyroscope
- accelerometer
- gravity
- magnetometer
<string name = "unusable_sensors_message"> </string>
Best,