webglearth / webglearth2-offline Goto Github PK
View Code? Open in Web Editor NEWExample of offline use of WebGL Earth 2 with tiles rendered by MapTiler
Home Page: https://github.com/webglearth/webglearth2-offline/archive/gh-pages.zip
Example of offline use of WebGL Earth 2 with tiles rendered by MapTiler
Home Page: https://github.com/webglearth/webglearth2-offline/archive/gh-pages.zip
=========== WebGL Earth =========== WebGL Earth is an open source software enabling to explore, zoom and βplayβ with the globe in any browser on any platform including mobile devices. The project lives from support and cooperation of developer community. The project is a free software available under standard [http://www.webglearth.org/license GPLv3 license]. We welcome anybody to [http://www.webglearth.org/contribute contribute] or just [http://www.webglearth.org/feedback send feedback] on the development of this project. ==Features:== * Rotation and zoom of the globe * Runs without a plugin in modern webbrowsers * Displays existing maps (OpenStreetMap, Bing, ...) * Supports custom map tiles in [http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/ popular mercator system] ==Requirements:== * A web browser with support for HTML5 Canvas and WebGL extension (Firefox4, Chrome 9+, ... mobile devices iPhone / iPad / Android later on) * Programming language: JavaScript (compiled with Closure compiler). ==Quickstart for developers:== Setup instructions can be found in [http://www.webglearth.org/quickstart quickstart section] at project's website.
Hi @klokan
I've noticed that when I move from using the CDN api (<script src="http://www.webglearth.com/v2/api.js"></script>)
) to the locally-hosted '/v2/api.js' implementation, it's displaying a wide range of errors (in the order of thousands!) in OSX Safari 10.0.1 that aren't problematic in Firefox or Chrome (OSX, 10.12.1). This is seen on both a local python server, as well as my live production environment.
The plugin itself is initialising, and you can see the markers appearing and animating at their correct co-ordinates. The issue seems to reside in the rendering of the sphere itself.
The CDN hosted version works without a problem, so the obvious solution at the present is to use that. However, I thought I'd let you know that these errors exist if you weren't already aware.
On a related note, there seems to be a problem with both the locally hosted and CDN versions in IE11. I am aware this has been previously reported however. (Below from Edge 20.10240)
SCRIPT5022: RuntimeError: The browser supports WebGL, but initialization failed.
Error
at t (http://www.webglearth.com/v2/api.js:428:16014)
at H (http://www.webglearth.com/v2/api.js:462:31759)
at Dt (http://www.webglearth.com/v2/api.js:473:4281)
at Y (http://www.webglearth.com/v2/api.js:563:475)
at Anonymous function (http://www.webglearth.com/v2/api.js:636:356)
at initialize (http://fintech.ipventures.com.au/:67:9)
at Anonymous function (http://fintech.ipventures.com.au/:475:4)
at i (http://fintech.ipventures.com.au/node_modules/jquery/dist/jquery.min.js:2:27146)
at j.fireWith (http://fintech.ipventures.com.au/node_modules/jquery/dist/jquery.min.js:2:27856)
at ready (http://fintech.ipventures.com.au/node_modules/jquery/dist/jquery.min.js:2:29705)
api.js (462,31759)
I'd also like to say a massive thanks to you for this project, I'm adapting it into a collateral site at present and while I'm possibly pushing the plugin to it's upper limits, it's a great piece of code. So thanks for putting in the hard yards developing it.
I try to use it in .js component code with react as following:
import React from 'react'
import * as WE from 'webglearth2-offline-gh-pages/v2';
class FlightInfo extends React.Component {
componentDidMount() {
this.initMap();
}
initMap() {
// Offline tiles
this.map = new WE.map('map');
this.map.setView([46.8011, 8.2266], 2);
WE.tileLayer('{z}/{x}/{y}.jpg', {
tileSize: 256,
bounds: [[-85, -180], [85, 180]],
minZoom: 0,
maxZoom: 16,
attribution: 'WebGLEarth example',
tms: true
}).addTo(this.map);
}
render() {
return(
When I am trying to run with CALL npm run dev I am receiving module not found error:
./src/components/flightInfo/FlightInfo.js
Module not found: Can't resolve 'webglearth2-offline-gh-pages/v2' in 'C:\heli-2020\tstWacs3Dbrancht\src\components\flightInfo'
Is there a way to resolve this error?
I want to use WEbglearth2 as offline.
I did everything and it's working well, except loading tiles. there is no world in the web browser, when I open.
and I understood that I should change CESIUM_BASE_URL
in api.js.
CESIUM_BASE_URL = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//www.webglearth.com/v2/';
https://raw.githubusercontent.com/webglearth/webglearth2-offline/gh-pages/v2/api.js
How can I change it, and make completely offline map?
Hi,
First, very nice project it's fast and well designed I like it and I want to use it for a project in my company.
We need this project to be 100% offline (which is great because it's exactly hat this repo does).
My problem now is to find good tiles offline to download because in the repository zoom goes only up to 5 (I know it's a big amount of data).
MapTiler doesn't give maps sources, and I've been looking a lot of sources and cannot find anything working like the same mapping so I wanna to ask where did you find your map, maybe you know a good way to do this ?
(I still can load a online app and save from cache but this will take a lot of time and probably not from open source).
I have apache running on Ubuntu 15.04. I used that to access index.html. It worked. Later, I cleared my browser's cache and disconnected myself from the Internet. It stopped working. When I now open index.html, I just see a blank page with a gradient; no earth.
I thought maybe I haven't set up things correctly, so I turned off security restrictions in Firefox (by setting security.fileuri.strict_origin_policy
to false
). But earth was again absent when I directly opened index.html.
unconstrainedRotation set to true don't do anything.
"Offline" means if someone double-clicks a file and all the scripts and tiles are properly in place, then it should work. Without needing to install and deploy a web-server. That is not something regular people do. Regular computers don't have python installed. The whole intention of taking WebGL offline is to take 3D maps to places beyond the internet divide.
Leaflet, Mapbox etc are all working fine when someone just double-clicks the html to open in a web browser. Why then does WebGL have an artificial restriction created inside its javascript to prevent genuinely offline operation? And why is the user being instructed to do a difficult workaround instead of just fixing the code?
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.