i found the nullexception error  just a stupid but
still  i cant get the anchor good it still puts the anhcor (0.5f,0.5f)
i dont use a markers container, but put the markers on the mapobject cnt
Mapcontainer cnt = new Mapcontainer();

i used twee kind of codes to fix the anchor  without good result
1 with markeroptions

Encodeimage  pic1 = EncodedImage.create("/kano.jpg"));
MapContainer.MarkerOptions mo1 = new MapContainer.MarkerOptions(position, 
pic1)
                .anchor(0.5f, 1f)
                .text("Marker At")
                .longText("Marker At")   
                .onClick((evt) -> {
                   
                  Dialog.show("Marker At", "Marker At" , "OK", null);
                 });

               MyLocation =         cnt.addMarker(mo1);   

2  with  a scaleimagebutton
  ScaleImageButton       FButton = new ScaleImageButton ();
                FButton.setIcon(EncodedImage.create("/kano.jpg"));
                
FButton.setBackgroundType(Style.BACKGROUND_IMAGE_SCALED_FILL);

                FButton.addActionListener((e) ->fillclick(Weergave));

          if (  FButton != null   ) {
                   //cnt.rremoveMapObject(FButton );
                   cnt.removeComponent(FButton );
                           }

      
           cnt.addMarker(FButton,position, 0.5f, 1);



Op woensdag 13 november 2019 03:18:12 UTC+1 schreef Shai Almog:
>
> Where did you get the marker options object from and what's the stack of 
> the NullPointerException you got?
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/44989c8b-7d47-4b74-b6e0-1950cb0f45b2%40googlegroups.com.

Reply via email to