Coder Social home page Coder Social logo

nasaworldwind / webworldwind Goto Github PK

View Code? Open in Web Editor NEW
860.0 860.0 378.0 65.06 MB

The NASA WorldWind Javascript SDK (WebWW) includes the library and examples for creating geo-browser web applications and for embedding a 3D globe in HTML5 web pages.

JavaScript 98.90% HTML 0.76% CSS 0.31% Shell 0.03%
3d browser earth geospatial globe html5 imagery javascript nasa sdk terrain webgl worldwind

webworldwind's People

Contributors

akelux avatar balhar-jakub avatar beak-man avatar carla-orru avatar claudiaifrim avatar eirizarry avatar emxsys avatar gabrieleprestifilippo avatar markpet49 avatar nicolasvila avatar pdavidc avatar randolphkim avatar revision0 avatar revo09 avatar rsirac avatar servetg avatar strikerm avatar tag3 avatar yvese avatar zglueck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webworldwind's Issues

Sometimes SurfaceShapeTile updates incorrectly at different zoom levels

From what I see, this happens because tiles that are not needed in the current frame have their shapes cleared and at the same time prevSurfaceShapes will be set to the currentShapes.
When the tile is needed the updateIfNeeded method can not detect the difference between previous and current and the texture is never updated.

On possible fix would be to separate clearing shapes form setting the prevSurfaceShapes and setting
prevSurfaceShapes in updateTexture.
The state key is also set in updateTexture.

https://gist.github.com/strikerM/2aa6748c2e28a95c7365072d69e7e6d4

Release versions

It would be really good if Web World Wind would have a proper release procedure with versions, and those versions should then also be tagged as git tags and the release artifacts (js file) put into the corresponding github release.

Compass does not honor size property

In Compass.js there is a size property but in Compass.prototype.render the size is hard-coded to 0.15:

this.imageScale = 0.15 * dc.currentGlContext.drawingBufferWidth / t.imageWidth;

GestureRecognizer not setting _mouseButtonMask correctly

Child of #508

When disabling the GestureRecognizer upon a mouse down (registered via addEventListener from WorldWindow), then enabling again via mouse down, _mouseButtonMask is not getting set correctly. Here's my use case:

  1. User control-left clicks then left-clicks to select multiple Placemarks. I do not want the map to move because another option is for the user to control-left-click (and hold the left mouse button) to select a region. Therefore I set the GestureRecognizer to false.
  2. User then releases ctr key and right clicks which opens up a context menu (but same behavior exists without my context menu).
  3. When the user moves the mouse with no keys down and no mouse button down the map will move as if the left mouse button is down.

I tracked it down to _mouseButtonMask not getting the bits cleared out. As a workaround I set that field in my code in the mouse down handler:

if(evt.ctrlKey) {
this.wwd.navigator.primaryDragRecognizer.enabled = false;
}
else if(!this.wwd.navigator.primaryDragRecognizer.enabled) {
this.wwd.navigator.primaryDragRecognizer.enabled = true;
this.wwd.navigator.primaryDragRecognizer._mouseButtonMask = 0;
}

This appears to fix the issue. If this is not clear email me and I can explain further.

AtmosphereLayer should react to its time property

Every layer in WebWW has a time property. We are about to include an util for computing the position of the sun for the new star field layer. This new layer automatically adapts depending on the value of its time property. I thus propose that the atmosphere layer also react to its time property by computing the location of the light source automatically.

Nonetheless, I wouldn't remove the lightLocation property altogether because it might be useful to applications, which need to position the sun at a defined location. Whenever, the time is set, we could simply set the lightLocation accordingly. This would still give an application the opportunity to set the lightLocation manually.

What do you think?

Z-Index of place mark has different results

I submitted a question on the Forum but no replies and this looks to be a bug. Here is the content of the forum post (http://forum.worldwindcentral.com/showthread.php?46248-Set-z-index-of-a-place-mark&p=125652#post125652) EDIT: Link is no longer valid:

"The app I'm building can have overlapping place marks. When the user clicks on one that is behind another I want to bring the selected place mark to the top. (I have a sprite place mark that renders a border around an image of a place mark.) I've tried setting alwaysOnTop to true but that does not work. I also have tried setting the eyeDistance to a very small number (everywhere from 0 to 10) separate and in conjunction with the alwaysOnTop. I recompiled the Web World Wind library to not uglify (option passed to requirejs) and when setting eyeDistance and alwaysOnTop, it does work. However the uglified version does not."

** On the forum post I have two images of the uglified vs. non-uglified results.

ElevationModel can request data outside valid latitude range

ElevationModel can request elevation tiles with latitude +90 to +135. This issue does not result in any exception or error for the built-in NASA elevation server, but does generates eight unnecessary elevation tile requests. However, when ElevationModel is configured to use a WCS service, this results in a service exception.

Shape textures appear upside down

Texture images for some shapes appear upside down under certain conditions. Affected shapes are:

  • Polygon
  • TriangleMesh
  • GeographicMesh

This issue can be reproduced by configuring any of these shapes with a texture image and displaying a Placemark without an image in the same scene. The issue relates to #79.

SurfaceShape does not render changes of the attributes

After updating an attribute (such as the interior color) of a SurfaceShapeTile renderable, the method to check if anything changed: "SurfaceShapeTile.prototype.needsUpdate", returns false, while it should return true.
Thus, the shape does not change on the globe.

Authenticated Imagery Sources with TileImageLayer

TileImageLayer forces the origin on image requests to "anonymous", see:

https://github.com/NASAWorldWind/WebWorldWind/blob/master/src/layer/TiledImageLayer.js#L480

image.crossOrigin = 'anonymous';

This doesn't work for servers requiring authentication. The appropriate value in this situation is "use-credentials".

As discussed with the development team, there is an upcoming refactoring of the image layers that will decouple the tile retrieval mechanism. This issue will be addressed as part of this refactoring.

speed-up

In my experiments with web world wind engine i found the way to minimize lags on slow machines while rotating the earth.

I do following:

By right mouse i apply following crutches:

  • limit throughput of loading tiles by TiledImageLayer and ElelevationModel
  • disable Picking mode at all

And removing this crutches bu right mouse up.

I hope it will be helpful, if you want i can show my code =) good luck

Sometimes the annotation text is upside down.

That's because the loading of texture coordinate matrix has been omitted.
A solution would be:

  1. texCoordMatrix initialization in Annotation's constructor
    line 115:
    // Internal use only. Intentionally not documented.
    this.texCoordMatrix = Matrix.fromIdentity();

  2. texCoordMatrix loading in Annotation.prototype.doDrawOrderedAnnotation, after program.loadTextureEnabled(gl, textureBound);
    line 513:
    this.texCoordMatrix.setToIdentity();
    this.texCoordMatrix.multiplyByTextureTransform(this.labelTexture);
    program.loadTextureMatrix(gl, this.texCoordMatrix);

"Is not a constructor" error with GeoJSONGeometry

I am trying to call the GeoJSONGeometry constructor. "new WorldWind.GeoJSONGeometry(...) " and i am not sure as to why it is giving me a "is not a constructor" error. Also when i try console.log(WorldWind.GeoJSONGeometry) it comes up as undefined.

WMTS object model alignment

Child of #551

The WebWorldWind WMTS implementation should be aligned with the WorldWindAndroid implementation. While most of the architecture and property naming does match between the two SDKs, the following items have not been resolved:

  • WmtsLayerCapabilities -> WmtsLayer rename (pending current WmtsLayer future)
  • plural property names (e.g. layer vs layers) in array based properties
  • boundingBox assumes two values in the upper and lower corner elements (Android just stores the strings) The specification indicates only two values

Completing these items may introduce breaking changes or name space conflicts into the current implementation, based on commit 9bd0d5d.

GLSL Link Program Error on Internet Explorer 11

While attempting to load BasicExample.html WebWorldWind with an updated Internet Explorer 11, an error message to the console states: "linkProgram: Internal linker error". This error is followed by a number of null or undefined shader attribute errors.

This behavior has only been observed in IE11 on Windows 7 machines. A similar test with Windows 10 did not exhibit the error. Chrome and Firefox on the same Windows 7 machine do not have the same error.
errorlist1

Cannot read property 'getContextAttributes' of null

I just cloned this repository and tried displaying the SimplestExample.html example, but nothing showed up (just a blank browser page). In fact, none of the examples in the examples/ directory work.

What's more is that the web demo at https://worldwind.arc.nasa.gov/ does not work either. When I opened up my JS console to see if there were any error messages, I found this trace:

/js/libs/webworldwind/worldwind.js:80924 Uncaught TypeError: Cannot read property 'getContextAttributes' of null
    at WorldWindow.createContext (/js/libs/webworldwind/worldwind.js:80924)
    at new WorldWindow (/js/libs/webworldwind/worldwind.js:80523)
    at /js/main.js:98
    at Object.execCb (require-debug.js:1665)
    at Module.check (require-debug.js:874)
    at Module.<anonymous> (require-debug.js:1121)
    at require-debug.js:132
    at require-debug.js:1171
    at each (require-debug.js:57)
    at Module.emit (require-debug.js:1170)
    at Module.check (require-debug.js:925)
    at Module.<anonymous> (require-debug.js:1121)
    at require-debug.js:132
    at require-debug.js:1171
    at each (require-debug.js:57)
    at Module.emit (require-debug.js:1170)
    at Module.check (require-debug.js:925)
    at Module.<anonymous> (require-debug.js:1121)
    at require-debug.js:132
    at require-debug.js:1171
    at each (require-debug.js:57)
    at Module.emit (require-debug.js:1170)
    at Module.check (require-debug.js:925)
    at require-debug.js:624
    at each (require-debug.js:57)
    at breakCycle (require-debug.js:613)
    at require-debug.js:626
    at each (require-debug.js:57)
    at breakCycle (require-debug.js:613)
    at require-debug.js:626
    at each (require-debug.js:57)
    at breakCycle (require-debug.js:613)
    at require-debug.js:700
    at each (require-debug.js:57)
    at checkLoaded (require-debug.js:699)
    at Object.completeLoad (require-debug.js:1583)
    at HTMLScriptElement.onScriptLoad (require-debug.js:1686)

I'm running Google Chrome v56.0.2924.87 on Ubuntu 16.10 64-bit. Is this a known issue? Surely the web demo should be working?

Atmosphere layer suffers from clipping

See #102 for the initial bug report. This is a known issue that we plan to address using an option currently in feature/camera. This will be done similarly as in Android here: https://github.com/NASAWorldWind/WorldWindAndroid/blob/master/worldwind/src/main/java/gov/nasa/worldwind/WorldWindow.java#L1023

In the meantime, you can artificially increase the far clip distance in Navigator.js in Navigator.prototype.currentStateForModelview:

this.farDistance = WWMath.horizonDistanceForGlobeRadius(globeRadius, eyePos.altitude);
this.farDistance += 1437568.7253136805; //<-- add this line
if (this.farDistance < 1e3)
    this.farDistance = 1e3;

Load higher level tiles to avoid blurrying

Child of #568

screenshot

On the left there's the WebWorldWind globe, on the right is the tile image that was loaded from virtualearth in its native resolution. As you can see, WebWorldWind zooms in quite a lot, making it blurry. In my opinion it is picking the wrong tile level for the zoom that it is in. Or am I missing something?

Offer unminified js file

For debugging it is helpful to have an unminified JS file of webworldwind. It would be convenient if that could be produced as part of the normal releases, maybe named webworldwind.src.js. The optimize: 'none' option in the grunt file for the requirejs task seems to do the trick.

HTTPS Availability of Blue Marble and Landsat Imagery

High David. Gary Christenot here from the WorldWind TEM. It was great getting to meet you and the rest of the World Wind team. The TEM provided me with some great insights and ideas on where to take our World Wind project next. Based on our experience at Eglin I want to take a very deep dive look at Web World Wind.

I had some time Thursday night after the conclusion of the conference as well as several hours in the airport to do some exploration of Web World Wind as a self-hosted site. I set up IIS on my laptop, pulled in all of the files as local resources, including the Bootstrap, jquery, requireJS libraries, and changed the script references in the BasicExample accordingly. IE still seems to be a bit of an issue for me but successfully got FireFox and Chrome going as a local Web World Wind implementation. By monitoring network traffic I was able to verify that the only external calls going outside of my local web server were the pulls from NASA and Bing servers for the actual globe/map data. So that was a good start.

Where I hit a bit of a road block was trying to implement all of this over https, which is an iron clad requirement for any web application we host. I created a self-signed certificate and loaded it against my site to see how it would behave. The basic skeleton of the BasicExample loaded just fine, as did the Bing data. But NASA Blue Marble and Landsat imagery wouldn't load.

When I traced the network traffic, I could see that Blue Marble data was trying to load from https://worldwind25.arc.nasa.gov/wms and was not getting any response. Digging deeper in to the code I found in the BMNGLayer.js source that it is using location.protocol to set the protocol of the URL to the same as the site. To overcome my immediate issue I changed the code in BMNGLayer.js to hard wire it to "http" instead of location.protocol. That allowed the Blue Marble and Landsat imagery to load in to my World Window, but with a security complaint from the browser about mixed http/https content that had to be acknowledged.

It would seem that based on your use of location.protocol to build the imagery URL that access via either HTTP or HTTPS was to be expected. Is there something I'm missing?

In order to go forward I will definitely need to have access to an imagery source that is accessible over HTTPS, whether that is something NASA provides, I have to self-host, or perhaps can hook on to at NGA or other U.S. Government agency. While the integrity of NASA servers is obviously not in doubt, I can't guarantee that our user's would have the option of acknowledging and accepting warnings on mixed HTTP/HTTPS traffic in the browser. I have elevated privileges but most of our users would probably have their browsers locked down to not be able to accept that warning. And if they aren't locked down now, they very well could be in the future.

If NASA imagery isn't available over HTTPS, do you know if, as a U.S. Government agency, there are NGA or other U.S. Government mapping servers I might point to that would be HTTPS?

I'll reserve the idea of hosting data on an internal HTTPS resource as a last resort.
I mentioned to you that I have the Blue Marble and Landsat data in the older DDS format being served up from a local instance of World Wind WMS server that was included in v1.5 and earlier. Technically I shouldn't be hosting that on my application server since it is an HTTP resource. But because all users are on my internal network it has been allowed to slide thus far. But you mentioned there was a way I could use that data. If I have to come back to the idea of hosting my own HTTPS imagery source, perhaps we could revisit that in a later conversation.

Looking forward to working with you guys going forward!

Gary

Bing maps key not send in the URL

When creating a Bing Layer with a personal Bing maps key, the key is not send in the URL.
Then the response received is
gov_nasa_worldwind_jsonp_0({"authenticationResultCode":"InvalidCredentials","brandLogoUri":"http://dev.virtualearth.net/Branding/logo_powered_by.png","copyright":"Copyright © 2017 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"a32b43659ea6455d85fc0fb6a950c516|DB40080942|7.7.0.0|"})

preventDefault doesn't work in the case of mouse leaving and entering the canvas with moudown

Child of #508

This issue shows up when the mouse is pressed while inside the canvas and is then dragged outside of the canvas and then returned to the canvas.

To replicate

  1. add an event listener to pointermove and mousemove where it only fires preventDefault
this.worldWindow.addEventListener('pointermove', function(event) {
  event.preventDefault();
});
this.worldWindow.addEventListener('mousemove', function(event) {
  event.preventDefault();
});
  1. press and hold the left mouse button inside the canvas
  2. drag the mouse outside of the canvas while still holding the mouse button
  3. return the mouse to the canvas with the mouse still depressed

The map will now be dragging with the cursor.
This affects Chrome and Firefox

Aura around the globe?

Sorry if I skipped this in the documentation, but is it possible to draw an aura around the globe?

SurfaceShapeTile resource leak

SurfaceShapeTile keeps adding surfaceShape state keys and never releases them.
In some circumstances, this could cause the browser tab to crash.

One possible fix would be to clear the surfaceShapeStateKeys array in the clearShapes method.

WMS Capabilities based layer configuration

Enhance the existing WMS layer support by offering layer configuration from a WMS Capabilities response. The client layer should use all relevant information in the Capabilities document to configure itself, and require minimal configuration from the application.

Provide https version of js bundle

Many websites use https nowadays and including an http resource is not possible then. I tried https://worldwindserver.net/webworldwind/worldwindlib.js but it says that the SSL certificate is expired. A strong motivation for making this happen is that github pages enforces https:// since recently and this means that building small demo pages for WebWorldWind is only possible by copying the js file, which some may find to be a hassle, considering the size of it.

Loading several local DTMs

Child of #575

Hi,

I'm the lead devel of PlanetServer a tool to analyze hyperpesctral images of Mars and the Moon using web world wind and rasdaman. At the moment we are serving a global DTM using geoserver. One of our goals is to serve local higher resolution DTMs. We see that www is capable of serving one DTM but we are afraid that serving more than one will force us to reset the globe every time we select a new DTM. Is that the case? In case this is viable, would you suggest a way to approach it?

Thanks a lot

KML level of detail

Child of #565

The current implementation is to load all images at once, not processing LOD .it should level by level load。

HTTPS map services

Migrate the NASA map services used by Web World Wind to the HTTPS protocol.

Map Services

  • BingAerialLayer
  • BingAerialWithLabelsLayer
  • BingRoadsLayer
  • BingWMSLayer
  • BMNGLandsatLayer
  • BMNGLayer
  • EarthElevationModel
  • NominatinGeocoder
  • WcsEarthElevationModel

CompoundElevationModel

I would like to request a feature to compose elevations similar to the CompoundElevationModel found in WWJ.

Thanks!

ScreenImages clipped in FireFox when zoomed in on the globe

ScreenImages, like the Compass and ViewControls are clipped when you zoom in on the globe in FireFox. The issue does not occur in Chrome.

Following are three progressive screenshots from the SDK's Explorer app/demo demonstrating the issue.

Screenshot 1

image
Zoomed out: No clipping

Screenshot 2

image
Zoomed in: Partial clipping of Compass and ViewControls

Screenshot 3

image
Zoomed in further: Compass and all but one of ViewControls are gone. Note the PanControl ScreenImage remains. Interesting.

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.