FlowingCode / GoogleMapsAddon

Vaadin Addon based on Google Maps Web Component
https://www.flowingcode.com/en/open-source/
Apache License 2.0
19 stars 7 forks source link

Internally manage trackLocationId #133

Closed javier-godoy closed 1 month ago

javier-godoy commented 1 month ago

Feature proposal

Enhance the location tracking functionality by refactoring GoogleMap to internally manage the trackLocationId. This will streamline the user experience.

The current implementation has a stopTrackLocation(int) method requiring a trackLocationId parameter. This approach is redundant and can be simplified by refactoring the GoogleMap class to manage the trackLocationId internally.

Describe solution expectations

Refactor GoogleMap class: modify the GoogleMap class to internally store and manage the trackLocationId.

Implementation Details:

public class GoogleMap {
    private int trackLocationId;

    public void trackLocation() {
        // Logic to start tracking and obtain the trackLocationId
        trackLocationId = ...; // Obtain and store the trackLocationId
    }

    public void stopTrackLocation() {
        // Logic to stop tracking using the stored trackLocationId
        if (trackLocationId != 0) {
            // Stop tracking logic using trackLocationId
        }
    }
}

Benefits:

By implementing this enhancement, the gmaps class will provide a cleaner, more user-friendly API, reducing the potential for errors and improving the overall code quality.

Additional information

No response

paodb commented 2 weeks ago

Released in version 2.0.0.