4646import java .util .ArrayList ;
4747import java .util .List ;
4848import java .util .concurrent .CompletableFuture ;
49+ import lombok .experimental .ExtensionMethod ;
4950import org .apache .commons .lang3 .StringUtils ;
5051
5152@ SuppressWarnings ("serial" )
5455@ NpmPackage (value = "@flowingcode/google-map" , version = "3.9.0" )
5556@ NpmPackage (value = "@googlemaps/markerclusterer" , version = "2.0.8" )
5657@ JsModule ("./googlemaps/geolocation.js" )
58+ @ ExtensionMethod (value = JsonMigration .class , suppressBaseMethods = true )
5759public class GoogleMap extends Component implements HasSize {
5860
5961 private Integer trackLocationId = null ;
@@ -519,7 +521,7 @@ public Registration addClickListener(ComponentEventListener<GoogleMapClickEvent>
519521 DomListenerRegistration registration =
520522 getElement ()
521523 .addEventListener ("google-map-click" , ev -> {
522- JsonObject latLng = JsonMigration .getEventData (ev ).get ("event.detail.latLng" );
524+ JsonObject latLng = ev .getEventData ().get ("event.detail.latLng" );
523525 listener .onComponentEvent (new GoogleMapClickEvent (this , true , latLng ));
524526 }).addEventData ("event.detail.latLng" );
525527 return registration ::remove ;
@@ -531,7 +533,7 @@ public Registration addRightClickListener(ComponentEventListener<GoogleMapClickE
531533 DomListenerRegistration registration =
532534 getElement ()
533535 .addEventListener ("google-map-rightclick" , ev -> {
534- JsonObject latLng = JsonMigration .getEventData (ev ).get ("event.detail.latLng" );
536+ JsonObject latLng = ev .getEventData ().get ("event.detail.latLng" );
535537 listener .onComponentEvent (new GoogleMapClickEvent (this , true , latLng ));
536538 }).addEventData ("event.detail.latLng" );
537539 return registration ::remove ;
@@ -768,7 +770,7 @@ public Registration addGoogleMapBoundsChangedListener(
768770 DomListenerRegistration registration =
769771 getElement ().addEventListener ("google-map-bounds_changed" , ev -> {
770772 listener .onComponentEvent (new GoogleMapBoundsChangedEvent (this , true ,
771- new LatLonBounds (JsonMigration .getEventData (ev ).get ("event.detail" ))));
773+ new LatLonBounds (ev .getEventData ().get ("event.detail" ))));
772774 }).debounce (1000 , DebouncePhase .TRAILING ).addEventData ("event.detail" );
773775 return registration ::remove ;
774776 }
@@ -804,7 +806,7 @@ public void addCustomControls(CustomControl... customControls) {
804806 customControl .getControlButton ().getElement ().setAttribute ("slot" , "customControlSlot_" + i );
805807 getElement ().appendChild (customControl .getControlButton ().getElement ());
806808 }
807- JsonMigration . setPropertyJson ( getElement (), "customControls" , jsonArray );
809+ getElement (). setPropertyJson ( "customControls" , jsonArray );
808810 }
809811
810812 /**
@@ -823,7 +825,7 @@ public void setCustomControls(CustomControl... customControls) {
823825 getElement ().appendChild (customControl .getControlButton ().getElement ());
824826 this .customControls .add (customControl );
825827 }
826- JsonMigration . setPropertyJson ( getElement (), "customControls" , jsonArray );
828+ getElement (). setPropertyJson ( "customControls" , jsonArray );
827829 });
828830 }
829831
@@ -925,6 +927,6 @@ public void setMapStyle(MapStyle... mapStyles) {
925927 MapStyle mapStyle = mapStyles [i ];
926928 jsonArray .set (i , mapStyle .getJson ());
927929 }
928- JsonMigration . setPropertyJson ( getElement (), "styles" , jsonArray );
930+ getElement (). setPropertyJson ( "styles" , jsonArray );
929931 }
930932}
0 commit comments