@@ -300,14 +300,6 @@ GeoViewExamples class >> exampleGeoCircles [
300300 objects := self createGeoCircles: 1000 .
301301 element addObjects: objects.
302302
303- " Example of event handler behavior on geoView domain event"
304- element addEventHandlerOn: GeoViewCursorCoordinatesChangedEvent do: [ :event |
305- event absoluteCoordinates printString traceCr.
306- ].
307-
308- " Example of custom EventHandler, here a logger"
309- element addEventHandler: (GeoViewEventLogger new ).
310-
311303 ^ self openViewInWindow: element
312304]
313305
@@ -333,6 +325,22 @@ GeoViewExamples class >> exampleGeoCirclesAddedOneByOne [
333325 ^ self openViewInWindow: element
334326]
335327
328+ { #category : #' examples - GeoObjects' }
329+ GeoViewExamples class >> exampleGeoCirclesProjected [
330+ " Same example as exampleGeoCircles but with projected circles (due to projection deformation)"
331+
332+ | element objects |
333+ element := GeoViewUtils createGeoViewForGeoObjects.
334+
335+ (element getLayer: #GeoObjectsLayer ) setProcessData: (GeoCircleProjectedProcessData new ) forClass: GeoCircle .
336+
337+ " create sample datas"
338+ objects := self createGeoCircles: 100 do: [ :e | e radiusInMeters: 1000000 ].
339+ element addObjects: objects.
340+
341+ ^ self openViewInWindow: element
342+ ]
343+
336344{ #category : #' examples - GeoObjects' }
337345GeoViewExamples class >> exampleGeoEllipse [
338346
@@ -678,6 +686,51 @@ GeoViewExamples class >> exampleLargestCountriesOfTheWorld [
678686 ^ self openViewInWindow: geoView
679687]
680688
689+ { #category : #' examples - interactions' }
690+ GeoViewExamples class >> exampleMeasuringRuler [
691+ " This example show how to use a MeasuringRuler with a custom process data"
692+
693+ | element layer instructionsText |
694+ element := GeoViewElement new id: #geoView .
695+ element addLayer: (GeoViewMapTilesLayer newWithOpenStreetMap).
696+
697+ " Create a new layer to display the measure tool"
698+ layer := GeoViewDomainObjectsLayer new name: #tools .
699+ layer setProcessData: (GeoMeasuringRulerProcessData new ) forClass: GeoMeasuringRuler .
700+ element addLayer: layer.
701+
702+ " Create a text to display instructions"
703+ instructionsText := BlTextElement new
704+ background: Color white;
705+ effect: (BlGaussianShadowEffect color: (Color gray alpha: 0.5 ) width: 10 offset: 0 @0 );
706+ constraintsDo: [ :constraints |
707+ constraints horizontal fitContent.
708+ constraints vertical exact: 15 .
709+ constraints padding: (BlInsets all: 10.0 ) ];
710+ id: #instructionsText ; text: ' Double click on a position to start a measurement, move the mouse and click another time to stay the ruler.' asRopedText;
711+ yourself .
712+ element addChild: instructionsText.
713+
714+ " create a controller to manager the ruler"
715+ element addEventHandler: GeoViewMeasuringRulerController new .
716+
717+ ^ self openViewInWindow: element
718+ ]
719+
720+ { #category : #' examples - interactions' }
721+ GeoViewExamples class >> exampleMeasuringRulerWithCircle [
722+ " This example show how to use a MeasuringRuler but with a process data which is display a circle in addition to the ruler"
723+
724+ | space geoView layer |
725+ space := self exampleMeasuringRuler.
726+
727+ geoView := space root childWithId: #geoView .
728+
729+ " change process data"
730+ layer := geoView getLayer: #tools .
731+ layer setProcessData: (GeoMeasuringRulerWithCircleProcessData new ) forClass: GeoMeasuringRuler .
732+ ]
733+
681734{ #category : #' examples - filters' }
682735GeoViewExamples class >> exampleObjectsFilterChanged [
683736
0 commit comments