Skip to content
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

Fixes #1808: added CesiumJS support for projects #1826

Merged
merged 3 commits into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script src="https://rawgit.com/Leaflet/Leaflet.draw/v0.2.4/dist/leaflet.draw.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js"></script>

<script src="libs/Cesium/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="libs/Cesium/Build/Cesium/Widgets/widgets.css" />
<script src="libs/cesium-navigation/cesium-navigation.js"></script>
<link rel="stylesheet" href="libs/cesium-navigation/cesium-navigation.css" />
</head>
<body>
<div id="container"></div>
Expand Down
7 changes: 7 additions & 0 deletions project/static/checkCesium.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var existsFile = require('exists-file');

var exists = existsFile('./libs/Cesium/Build/Cesium/Cesium.js');
if (!exists) {
process.exit(0);
}
process.exit(1);
60 changes: 59 additions & 1 deletion project/web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,33 @@
<finalName>__PROJECTNAME__</finalName>
<plugins>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>download-files</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- download file -->
<get src=" https://cesiumjs.org/releases/Cesium-1.17.zip"
dest="${basedir}/cesium.zip"
verbose="true"
usetimestamp="true"/>
<mkdir dir="${basedir}/libs/Cesium"/>
<unzip src="${basedir}/cesium.zip"
dest="${basedir}/libs/Cesium">
</unzip>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
Expand Down Expand Up @@ -166,6 +192,38 @@
</resources>
</configuration>
</execution>
<execution>
<id>CesiumJS</id>
<phase>process-classes</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/__PROJECTNAME__/libs/Cesium</outputDirectory>
<encoding>UTF-8</encoding>
<resources>
<resource>
<directory>${basedir}/libs/Cesium</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>CesiumJS-navigation</id>
<phase>process-classes</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/__PROJECTNAME__/libs/cesium-navigation</outputDirectory>
<encoding>UTF-8</encoding>
<resources>
<resource>
<directory>${basedir}/../MapStore2/web/client/libs/cesium-navigation</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

Expand Down
1 change: 1 addition & 0 deletions projectScripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"clean": "rimraf dist",
"compile": "npm run clean && mkdirp ./dist && webpack --config prod-webpack.config.js",
"start": "webpack-dev-server --progress --colors --port 8081 --hot --inline --content-base .",
"postinstall": "node checkCesium.js && mkdirp ./libs/Cesium && download --extract --out ./libs/Cesium https://cesiumjs.org/releases/Cesium-1.17.zip || echo Cesium already installed",
"test": "karma start ./karma.conf.single-run.js",
"continuoustest": "karma start ./karma.conf.continuous-test.js",
"mvntest": "karma start ./karma.conf.single-run.js --reporters junit,dots,coverage",
Expand Down