Remove Embedded Scale Display?

16 views
Skip to first unread message

chun...@gmail.com

unread,
May 13, 2021, 10:07:38 PM5/13/21
to openmap-users
The EmbeddedScaleDisplayPanel that gets injected into the map display by default doesn't render in screenshots.

So, I've added a ScaleDisplayLayer. Unfortunately, the EmbeddedScaleDisplayPanel is still there. In the picture below, the EmbeddedScaleDisplayPanel is showing 1000km. My ScaleDisplayLayer is showing 1500km.

No matter what I do, I cannot figure out how to remove the existing EmbeddedScaleDisplayPanel though.

I can *find* it using the maphandler:
EmbeddedScaleDisplayPanel esdp = mapHandler.get(EmbeddedScaleDisplayPanel.class);

Unfortunately, none of these things remove it:
mapHandler.remove(esdp); // Symmetric version of how I find it
openMapPanel.removeMapComponent(esdp); // Symmetric version of how it gets added
openMapPanel.findAndUndo(esdp); // A recursive find-and-destroy in the mappanel

So, what's the right way to purge it?

Cheers,
Gary

Screenshot at 2021-05-13 19-03-10.png

Don Dietrick

unread,
May 14, 2021, 12:07:41 PM5/14/21
to chun...@gmail.com, openmap-users
Hi Gary,

I’d extend the OverlayMapPanel and override the getComponentsFloatingOnMap(MapBean) method. You can make it return a JPanel configured with the components you want, and with the layout you want.

I remember taking a shot at trying to make an interface to control those widgets, but it was always kludgy.

Thanks for the nudge!

- Don
> <Screenshot at 2021-05-13 19-03-10.png>
>
>
> --
> You received this message because you are subscribed to the Google Groups "openmap-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openmap-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/openmap-users/b92d6606-4996-42ca-b48d-a25218694a04n%40googlegroups.com.
> <Screenshot at 2021-05-13 19-03-10.png>

chun...@gmail.com

unread,
May 14, 2021, 12:16:00 PM5/14/21
to openmap-users
I took a step back and realised I'm not really using *any* of the features in OverlayMapPanel; none of my users are using the navigation widgets at the top-left, either.

So, I just switched to using a BasicMapPanel. Problem solved

Gary
Reply all
Reply to author
Forward
0 new messages