Skip to content

Conversation

@LabordePierre
Copy link
Contributor

Start global refactoring to OpenSmock.
Works only with OpenSmock/OpenSmock#107
@LabordePierre LabordePierre self-assigned this Feb 9, 2026
@LabordePierre LabordePierre added enhancement New feature or request technical work Some technical stuff: technical debt, refactoring, cleanup, performance, writing unit tests, etc. pending Waiting for something labels Feb 9, 2026
@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

In this example:

exampleCirclesHover
	| geoView layer circle |
	geoView := GeoViewElement new.
	layer := GeoViewDShapesLayer new name: #shapes.
	geoView addLayer: layer.

        "Circle to add to the geoview"
	circle := (SmockDCircle key: #circle)
		          coordinates:
			          (geoView mapProjection projLatLonToCart:
					           AbsoluteCoordinates zero);
		          radius: 1000000;
		          strokeColor: Color green;
		          strokeWidth: 5.
	layer addDShape: circle.
	geoView addObject: circle.

        "My event"
	geoView addEventHandler: (BlEventHandler
			 on: BlPrimaryClickEvent
			 do: [ :evt |
					 | elements |
					 elements := geoView pickAt: evt position radius: 10.
					 elements results do: [ :each |
							 each dShape strokeColor: Color random.
							 geoView updateObject: each.
                                                         "Use the inspector to inspect the pick"
							 elements inspect ] ]).
	^ self openViewInWindow: geoView
image

When i click on 1 and change the zoom level: the circle change color.
When i click on 2 and change the zoom level: the circle do not change color.

I have 2 questions:

  • How do i say to my geoView that it need to be updated ?
  • Is this normal that the dShape has a radius of 1000000 but the associated gShapes only has a radius of 100 ?

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

For the review:

Better example

A simplier example than exampleCitiesHover would be nice.
Something simple, a circle when pressed or hovered that changed its color.

Remove the GeoViewPickingEvent

There is an event named GeoViewPickingEvent.
I found it very confusing.
This event is trigger by GeoViewInteractionsStrategy every time you try to select any (or zero) objects.
I would rename this event GeoCursorPressedEvent or GeoViewObjectSelectionPickingEvent

Fix the GeoViewLayerEvent

GeoViewLayerRemovedEvent and GeoViewLayerAddedEvent should herit GeoViewLayerEvent

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

I would change the methods #pickable: and #pickable with #isPickable and #isPickabe:.
With the prefix is i understand it is a boolean.

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

I think you should rename all the methods that contains the word pickingElement with the word pickedElement.
See:
https://www.wordreference.com/enfr/picking
https://www.wordreference.com/enfr/picked

pick = verbe
picking = nom
picked = adjectif

I am not an expert in english, so to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pending Waiting for something technical work Some technical stuff: technical debt, refactoring, cleanup, performance, writing unit tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants