-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue creating map with HTMLPanel #5
Comments
Hi, What I mentioned in issue #2 will obviously not work, that was untested code, my bad. The HTMLElement does not have a constructor in native javascript (https://developer.mozilla.org/en/docs/Web/API/HTMLElement), and since HTMLElement is meant to wrap the native javascript object, it will not work using a constructor. I have added two functions to the Document class (version 0.5-SNAPSHOT), so now you can do something like:
For some reason, the map does not render properly when using HTML inside HTMLPanel:
I advise you to keep with the elements for now. If you need other methods or properties from HTMLElement(https://developer.mozilla.org/en/docs/Web/API/HTMLElement) or Document (https://developer.mozilla.org/en-US/docs/Web/API/Element), you can add them and make a PR, I will integrate them into the project. |
I also got the error "Cannot read property 'gwidgets' of undefined". However for me, it was caused by trying to create a new LatLng, instead of using L.latLng(). Maybe check to see if you might be doing the same? I was able to cast an old-school gwt element with no problem: |
are you using the latest version ? the latest version uses elemental 2 types, so one way to do it would be:
|
I have the following code.
I get the following error in my console.
MapWidget.java:21 Uncaught TypeError: Cannot read property 'gwidgets' of undefined
The line the it complains about is
HTMLElement mapElement = new HTMLElement();
I believe it has to use a builder to create that but looking at what is available from L class there doesn't seem to be one.
I was following what was done in the following issue #2
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: