Community

Topic: Xamarin component

Camera / Markers not visible (SOLVED)

Bastian Buchholz
Wednesday, July 26, 2017

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

user profile image
Support Team  (expert)
Monday, July 31, 2017

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,

Bastian Buchholz
Monday, July 31, 2017

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

Boris
Friday, November 3, 2017

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...

user profile image
Support Team  (expert)
Friday, November 3, 2017

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
To edit the message that is displayed, you can define the following string in the strings.xml file
<string name = "unusable_sensors_message"> </string>
Best,

Sign in to add a comment