Code Monkey home page Code Monkey logo

Comments (11)

branflake2267 avatar branflake2267 commented on July 17, 2024

Hmmm, I think this has occurred before in one of the classes and I added a clear b/c the type null didn't pass correctly.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

Working up the fix

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

I have a branch with the fix, but I'm going to look for any of the others.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

Ah I remember where I did that, it was in Marker. If the fix I'm adding we can put something like this in place.

  /**
   * close the marker 
   */
  public final native void close() /*-{
    this.setMap();
  }-*/;

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

I pulled the fix #32

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

Merged with master. Waiting for CI to build and deploy. I'm going to close the issue, and if for some reason it still exists, please report it. Thanks for your help.

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on July 17, 2024

I see you ameliorated this with my workaround in each JSO.

    public final void setMap(MapWidget mapWidget) {
        if (mapWidget == null) {
            setMapImpl(null);
        } else {
            setMapImpl(mapWidget.getJso());
        }
    }

Of course now boilerplate code is repeated, but these are JSO's, so having a simple HasMap interface and AbstractMapLayer is a no go.

However there was an archetype example (response 13) on the GWT Groups Forum today that might serve as a workaround to prevent this common problem from occurring again.

This would mean that layers could be treated with interfaces... like in Java! Noticed this annoyance last week when I could not just have a MapLayer[] to hold the currently displayed layers.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

We could put this in a super class and inherit it into the sub classes that use the setMap. I've been doing that with some couchdb jso stuff.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

By the way, I'm not sure this is working. B/c null isn't getting translated correctly when used.

I think will have to chage it to setMap() with no arguments in the jsni.

   public final void setMap(MapWidget mapWidget) {
        if (mapWidget == null) {
            setMapImpl(null);
        } else {
            setMapImpl(mapWidget.getJso());
        }
    }

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on July 17, 2024

Odd, I had an example in the showcase (local, not committed) where for one of the custom layers I toggled it from setMap(map) and setMap(null) on button click. This made the layer appear and disappear over and over as expected.

Can you detail how I can reproduce that the failure to set null you're experiencing?

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on July 17, 2024

I think thats happened to me too, but I've had it happen twice and was thinking the same thing. First I think it happened in the Marker. Then recently in another class but I can't recall at the moment.

from gwt-maps-v3-api.

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.