isergio / cesiumjs4gwt Goto Github PK
View Code? Open in Web Editor NEWCesium GWT Wrapper based on GWT 2.8.x and JsInterop
Home Page: https://gis4fun.org/cesiumjs4gwt-showcase/
License: Apache License 2.0
Cesium GWT Wrapper based on GWT 2.8.x and JsInterop
Home Page: https://gis4fun.org/cesiumjs4gwt-showcase/
License: Apache License 2.0
Hi Sergio!
Can we get a recompile with the latest Cesium 1.42? They have added some nice new performance enhancements and other features:
https://cesium.com/blog/2018/02/01/cesium-version-1.42-released/
Cheers!
Hello,
Although the Cesium docs show an Entity's position as a PositionProperty, it allows setting the position via a CallbackProperty. For a simple example, I took the following showcase:
https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Billboards.html&label=Showcases
and added a new function:
var lat = 0.1;
function getPosition() {
lat = lat + 0.1;
if (lat >= 90) {
lat = 0.1;
}
return Cesium.Cartesian3.fromDegrees(-75.6, lat);
}
and replaced the billboard position with
position : new Cesium.CallbackProperty(getPosition, false),
The billboard position will then update each frame. I do not see a way within the framework to use a CallbackProperty for an entity's position.
I would be happy to work this issue, but wanted to make sure I was not missing something first.
Greetings:
It appears that MaterialProperty org.cesiumjs.cs.datasources.graphics.EllipseGraphics.materia
has been spelled incorrectly ("materia"), and is missing the "l" letter at the end of the JSProperty name.
Thank you for your work on this library, I enjoy using it.
Hi! awesome project, just one question I see you have created your own linker and you use "script" tags in modules that don't work in the xsiframe linker. Why don't you use the ClientBundle technique? (https://github.com/mstahv/g-leaflet/blob/master/src/main/java/org/peimari/gleaflet/client/resources/LeafletClientBundle.java)
i'm try to write my own code, but there is a problem when executing on the web.
here is my JAVA code
public class CesiumT1 extends Composite implements EntryPoint{
public void onModuleLoad() {
VerticalPanel VPanel = new VerticalPanel();
ViewerCesiumNavigationMixinOptions options = new ViewerCesiumNavigationMixinOptions();
options.defaultResetView = Rectangle.fromDegrees(71, 3, 90, 14);
options.enableCompass = true;
options.enableZoomControls = true;
options.enableDistanceLegend = true;
options.enableCompassOuterRing = true;
ViewerPanel csVPanel = new ViewerPanel();
csVPanel.getViewer().extend(viewerCesiumNavigationMixin.instance(), options);
VPanel.add(csVPanel);
initWidget(VPanel);
RootPanel.get().add(VPanel);
}
}
But there is only show the basic map but no Navigation tools.
Then got error messages
Uncaught TypeError: e is not a function
at Q.extend (Cesium.js:546)
at v_g$.akf_g$ [as buildPanel_0_g$] (CesiumT1.java:55)
at v_g$.w_g$ [as onModuleLoad_0_g$] (CesiumT1.java:94)
at Array.Kxc_g$ (com_00046CesiumT1_00046CesiumT1__EntryMethodHolder.java:3)
at initializeModules_0_g$ (ModuleUtils.java:44)
at vJ_g$ (Impl.java:239)
at yJ_g$ (Impl.java:298)
at Impl.java:77
at bxc_g$ (ModuleUtils.java:55)
at ViewerCesiumNavigationMixinOptions.java:29
How can i fix it ?
I'm attempting to use the PinBuilder to create custom pins with images, but I'm seeing issues at runtime.
As a test, using the PinBuilder.fromColor()
method works fine; this returns a CanvasElement
that gives a valid result when I call toDataUrl()
.
However, attempting to use PinBuilder.fromUrl()
also returns a CanvasElement
, and then I need it's data URL to set as my billboard's image
property, but when attempting to call CanvasElement.toDataUrl()
causes:
Exception: com.google.gwt.core.client.JavaScriptException: (TypeError) : this$static_0_g$.toDataURL is not a function
Attempting to call the similar method PinBuilder.fromUrlPromise()
doesn't even return a Promise; instead I see the same exception mentioned above, saying fromUrlPromise
is not a function.
Is this a known issue with the PinBuilder? Or is there something I'm missing for how this class is supposed to be used? TIA
Hi, Sergio
We are doing our project on Vaadin 8. Is it possible to include the Cesiumjs4gwt inside Vaadin 8 Application...?
When i try to put the ViewerPanel in MyUI class, then i'm getting the following error. Is it possible to resolve this error...?
Your comments and suggestion are much appreciated...
Thanks...
java.lang.NoClassDefFoundError: org/cesiumjs/cs/widgets/ViewerPanel
at com.company.MyUI$MyUIServlet.(MyUI.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2470)
at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1327)
at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:1220)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:496)
at org.eclipse.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:788)
at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:773)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:578)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.cesiumjs.cs.widgets.ViewerPanel
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:487)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:428)
... 37 more
Caused by:
java.lang.ClassNotFoundException: org.cesiumjs.cs.widgets.ViewerPanel
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:487)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:428)
at com.company.MyUI$MyUIServlet.(MyUI.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2470)
at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1327)
at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:1220)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:612)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:496)
at org.eclipse.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:788)
at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:773)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:578)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
I am getting the following error when adding a terrain layer to the base layer picker:
TypeError: this._terrainProvider.getLevelMaximumGeometricError is not a function.
To test this, I modified the CustomBaseLayerPicker.java::buildPanel method to be the following:
@Override
public void buildPanel() {
List<ProviderViewModel> imageryViewModels = new ArrayList<>();
List<ProviderViewModel> terrainViewModels = new ArrayList<>();
ProviderViewModelOptions options = new ProviderViewModelOptions();
options.name = "Open\u00adStreet\u00adMap";
options.iconUrl = GWT.getModuleBaseURL() + "cs/CesiumUnminified/Widgets/Images/ImageryProviders/openStreetMap.png";
options.tooltip = "OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org";
options.imageryProviderCreationFunction = new ProviderViewModel.ImageryProviderCreationFunction() {
@Override
public ImageryProvider[] function() {
return new ImageryProvider[] {Cesium.createOpenStreetMapImageryProvider("https://a.tile.openstreetmap.org/")};
}
};
imageryViewModels.add(new ProviderViewModel(options));
options = new ProviderViewModelOptions();
options.name = "Earth at Night";
options.iconUrl = GWT.getModuleBaseURL() + "cs/CesiumUnminified/Widgets/Images/ImageryProviders/blueMarble.png";
options.tooltip = "The lights of cities and villages trace the outlines of civilization \n" +
" in this global view of the Earth at night as seen by NASA/NOAA\\'s Suomi NPP satellite.";
options.imageryProviderCreationFunction = new ProviderViewModel.ImageryProviderCreationFunction() {
@Override
public ImageryProvider[] function() {
return new ImageryProvider[] {new IonImageryProvider(IonImageryProviderOptions.create(3812))};
}
};
imageryViewModels.add(new ProviderViewModel(options));
options = new ProviderViewModelOptions();
options.name = "Natural Earth\u00a0II";
options.iconUrl = GWT.getModuleBaseURL() + "cs/CesiumUnminified/Widgets/Images/ImageryProviders/naturalEarthII.png";
options.tooltip = "The lights of cities and villages trace the outlines of civilization \n" +
" in this global view of the Earth at night as seen by NASA/NOAA\\'s Suomi NPP satellite.";
options.imageryProviderCreationFunction = new ProviderViewModel.ImageryProviderCreationFunction() {
@Override
public ImageryProvider[] function() {
return new ImageryProvider[] {Cesium.createTileMapServiceImageryProvider(GWT.getModuleBaseURL() + "cs/CesiumUnminified/Assets/Textures/NaturalEarthII")};
}
};
imageryViewModels.add(new ProviderViewModel(options));
options = new ProviderViewModelOptions();
options.name = "Some Terrain";
options.iconUrl = GWT.getModuleBaseURL() + "cs/CesiumUnminified/Widgets/Images/ImageryProviders/naturalEarthII.png";
options.tooltip = "Some Terrain Description.";
options.terrainProviderCreationFunction = new ProviderViewModel.TerrainProviderCreationFunction() {
@Override
public TerrainProvider[] function() {
return new TerrainProvider[] {
Cesium.createWorldTerrain(
Cesium.CreateWorldTerrainOptions.create(true, true))};
}
};
terrainViewModels.add(new ProviderViewModel(options));
ViewerPanel csVPanel = new ViewerPanel();
csVPanel.getViewer().baseLayerPicker().viewModel.imageryProviderViewModels = imageryViewModels.toArray(new ProviderViewModel[0]);
csVPanel.getViewer().baseLayerPicker().viewModel.terrainProviderViewModels = terrainViewModels.toArray(new ProviderViewModel[0]);
contentPanel.add(new HTML("<p>Configure custom BaseLayerPicker widget.</p>"));
contentPanel.add(csVPanel);
initWidget(contentPanel);
}
The error appears when selecting the terrain from the base layer picker. The imagery added in this same way works fine.
Hello. I know not all Cesium capabilities are covered 100% but there is one in particular at the moment that I am interested in knowing the timeline for. Do you know when you will be filling out the ProviderViewModel class? Or do you have an example of filling out the baselayerpicker with custom imagery layers without using that class? Thank you in advance.
I am newbie for this development. i try to clone this code on eclipse and using Tomcat sever.
However error is everywhere in the project that i believe because it can't handle Import org.cesiumjs.cs.*
Can you help me ?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.