Giter Club home page Giter Club logo

Comments (2)

javier-godoy avatar javier-godoy commented on June 17, 2024 2

I agree, It would be also a good time for using the annotation-based configuration feature of commons demo (FlowingCode/CommonsDemo@d5ec76b) which is available ein 3.1.0-SNAPSHOT

from googlemapsaddon.

paodb avatar paodb commented on June 17, 2024

My idea for improving this demo is:

  • Create an AbstractGoogleMapsDemo class that extends from VerticalLayout and it's in charge to validate api key, so all different demo views extend from it.
    Something like:
@StyleSheet("context://frontend/styles/google-maps/demo-styles.css")
public abstract class AbstractGoogleMapsDemo extends VerticalLayout {
  
  public AbstractGoogleMapsDemo() {    
    this.setSizeFull();
    String apiKey = System.getProperty("google.maps.api");
    if (apiKey == null) {
      add(
          new H2(
              "Api key is needded to run the demo, pass it using the following system property: '-Dgoogle.maps.api=<your-api-key>'"));
    } else {
      createGoogleMapsDemo(apiKey);
    }    
  }

  protected abstract void createGoogleMapsDemo(String apiKey);

}
  • Split the current GoogleMapsDemo into 3 different demos:

    1 - BasicGoogleMapDemo: This will include de FlowingCode marker (not draggable), with the show coordinates & toggle info view buttons.

    2 - AddMarkersDemo: This will include adding markers with the selection of colors.

    3 - AddPolygonsDemo: This will include current add polygon example.

    Note: Draggable markers demo showing drag end coordinates will be another demo that I will be adding when I can complete #40 .

  • Then, I will update the current GeolocationDemo to extend this new abstract class.

What do you think @javier-godoy, @mlopezFC ?

from googlemapsaddon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.