Results 1 to 5 of 5

Thread: AnnotationView deprecation of Width/Height in 2.5

  1. #1
    Etablierter skobbler
    Join Date
    09.03.2015
    Posts
    11

    AnnotationView deprecation of Width/Height in 2.5

    Hi,

    I have recently upgraded to Skobbler 2.5, and am rather confused. I am trying to use custom annotations on the map to show truck drivers where they should go, and what to collect. Basically this means I have about 100 annotations on the map, and I want to either display a tiny little bag icon or a little bin icon. In Skobbler 2.4 this was working fine. However, in Skobbler 2.5, I can't set the width or height of the images. Obviously I have had to move to using ImageViews rather than directly setting the AnnotationView drawable. The icons that I was scaling to 32 pixels are now HUGE and fill up 90% of the map view.

    I have tried making the images smaller. This is not acceptable, because they end up blurry and bad looking.
    I have tried converting them to bitmaps and scaling the bitmaps, but this doesn't seem to work, and even if it did work, the bitmap scaling is only on Android API 19+ (which isn't acceptable for my use case).
    I have tried setting different scaling types and layout parameters for the ImageView, but this also doesn't work.

    What am I supposed to do here?

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    Hi Isaac,

    Can you please add the code snippets and the icons that you are using.

    Thank you,
    Adela

  3. #3
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    Same problem here, methods are deprecated but they still work and we can not work without them ..

    I changed the code so no deprecated methods are used anymore to

    Code:
    View v = inflator.inflate(R.layout.obj1001, null);
    annotationView.setView(v);
    But even my view (which contains simple image) has size 32dp x 32dp (I also changed them from 128 to 64) .. icon always is way too big and the same size, no matter what I write in size ..

    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="32dp"
        android:src="@drawable/obj1001"
        android:scaleType="fitCenter"
        android:layout_height="32dp">
    </ImageView>

  4. #4
    Etablierter skobbler
    Join Date
    11.04.2015
    Posts
    41
    OK, looks like I've managed to fix this issue

    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="32dp"
        android:layout_height="32dp">
        <ImageView
            android:layout_width="32dp"
            android:src="@drawable/obj1001"
            android:scaleType="fitCenter"
            android:layout_height="32dp">
        </ImageView>
    </RelativeLayout>
    simply wrap it in RelativeLayout

  5. #5
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    Thanks mz87 for adding the solution here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •