Code Monkey home page Code Monkey logo

Comments (17)

twistedpair avatar twistedpair commented on August 16, 2024

This appears to be a defect. This will be rectified shortly and we'll update this Issue. Thanks for reporting this.

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

Fixed this partially in 3826880.

Noticed 3 OverlayView methods are not implemented by GMaps at all, but you need to implement then as prototypes in your JSO.

We need to add either handlers or a Callback wrapper so the users can set their own implementations for

  • OverlayView.draw()
  • OverlayView.onAdd()
  • OverlayView.onRemove()

I added tests for them in the spirit of TDD that will pass once we've got this in their.

Also, the following two methods fail in GWTTestCase. I don't know whey since the other two work fine. This needs further investigation.

  • MapCanvasProjection.fromContainerPixelToLatLng()
  • MapCanvasProjection.fromLatLngToDivPixel()

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Nice. I can help take a look next week. I aim to get some more time in at working on some of these issues too. :)

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

Worth looking at how the autogenerated code did this....however, they did not do OverlayView. You can see their Overlay Solution.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

That link didnt work. It looks like it points at our overlay.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Looking at OverlayView.onAdd() in more detail, I see that method in the master, are you thinking that should be different, or did you add those?

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Oh I see, those functions are closures. Yeah, I see what we need to add. I think I wrote some callbacks like that in street view or somewhere else. I can't remember.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Saving this example to look at later: http://james.lin.net.nz/2012/05/24/google-map-v3-overlayview-code-sample/

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Another handy example we could use for testing: http://blog.mridey.com/2009/09/label-overlay-example-for-google-maps.html

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

Brandon, see the Official Google OverlayView example.

Also, fixed that link to the overlay code in the generated project's Overlay code..

I'm just not sure if this won't cause a problem since it is an expected prototype, not just a callback. Would something like the following work?

public final void setOnAddCallback( Callback callback ) /*-{
    this.onAddCallback = callback;
    setOnAddCallbackImpl();
)-*/

public final native void setOnAddCallbackImpl() /*-{
    this.prototype.onAdd = @this.onAddImpl()();
)-*/

private void onAddImpl() {
    this.onAddCallback.run();
}

(pseudocode, too late to lookup the JNI syntax)

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

I'm not sure, I haven't done that way. I like to use a handler interface with the callback method. I use an anonymous function for this.onAdd() = anon func and then I use that function to call the interface handler method. But that might not be the best way, I'm just pulling off what I usually do.

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

My concern is why this is the only case of the Maps API specifying an interface rather than an implementation or callback. Perhaps these functions needed a higher performance? In that case, allowing the users to set a callback and then defining the function with it might be more inline with the original Maps API architecture.

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

Currently 5 (intentionally) failing tests due to this. Will try to finalize the callback handlers tonight so they pass.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Let me know if you need a hand on the handlers :)

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

I've started on the overlay view.

  1. created a ground overlay example
  2. working on a custom overlay example
  3. working on the proto in OverlayView

from gwt-maps-v3-api.

twistedpair avatar twistedpair commented on August 16, 2024

We already have a demo. You can add to that. See the moon/mars showcase demo.

from gwt-maps-v3-api.

branflake2267 avatar branflake2267 commented on August 16, 2024

Good point. I'll use it for testing then merge it into the other when I'm done. :)

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.