public void setMarkers ( QueryResult queryResult ) { mapWidget . clearMarkers ( ) ; RecordList recordList = queryResult . getRecordList ( ) ; List < RecordList . Record > records = recordList . getRecords ( ) ; List < GenericMarker > markers = new ArrayList < GenericMarker > ( ) ; final MarkerCoordinateSource markerCoordinateSource1 = getMarkerCoordinateSource ( ) ; final MarkerDisplayFilter markerFilter = getMarkerDisplayFilter ( ) ; markerFilter . init ( ) ; for ( final RecordList . Record record : records ) { MapMarkerBuilder markerBuilder = new MapMarkerBuilder ( ) ; final MarkerCoordinateSource . LatitudeLongitude latitudeLongitude = markerCoordinateSource1 . process ( record ) ; double lat = latitudeLongitude . getLatitude ( ) ; double lon = latitudeLongitude . getLongitude ( ) ; if ( markerFilter . filter ( record ) ) { GenericMarker < RecordList . Record > marker = markerBuilder . setMarkerLat ( lat ) . setMarkerLon ( lon ) . setMarkerIconPathBuilder ( getMarkerIconPathBuilder ( ) ) . createMarker ( record , mapWidget ) ; marker . setupMarkerHoverLabel ( getMarkerHoverLabelBuilder ( ) ) ; marker . setupMarkerClickInfoWindow ( getMarkerClickInfoWindow ( ) ) ; marker . addClickHandler ( new GenericMarker . MarkerCallBackEventHandler < GenericMarker > ( ) { @ Override public void run ( GenericMarker sourceElement ) { clientFactory . getEventBus ( ) . fireEvent ( new MarkerClickEvent ( record ) ) ; } } ) ; markers . add ( marker ) ; } } mapWidget . setMarkers ( markers ) ; }
Contain logic for getting records building marker from results Called on start and when filters are changed