Skip to content

Commit

Permalink
Use again dist directory to save bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
elenatorro committed Jul 17, 2018
2 parents d131ac5 + 6a6f8a1 commit 46186bb
Show file tree
Hide file tree
Showing 35 changed files with 182 additions and 259 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.DS_Store
.vscode/
*_out.png
*_out.png
*.html
*.log
carto-vl.js
carto-vl.js.map
carto-vl.min.js
*.log
dist/
docs/all
docs/public
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*_out.png
*.html
*.log
dist/
docs/all
docs/public
node_modules/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Add GeoJSON layer | CARTO</title>
<title>External GeoJSON layer | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
Expand All @@ -17,10 +17,10 @@
<aside class="toolbox">
<div class="box">
<header>
<h1>Add layer</h1>
<h1>External GeoJSON layer</h1>
</header>
<section>
<p class="description open-sans">Add one CARTO layer to your map</p>
<p class="description open-sans">Add one external GeoJSON layer to your map</p>
</section>
<footer class="js-footer"></footer>
</div>
Expand All @@ -33,10 +33,6 @@ <h1>Add layer</h1>
</div>
</div>
<script>
function hideLoader() {
document.getElementById('loader').style.opacity = '0';
}

const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
Expand All @@ -47,20 +43,21 @@ <h1>Add layer</h1>
touchZoomRotate: false,
});

fetch( 'https://www.mapbox.com/help/data/stations.geojson' )
fetch('https://libs.cartocdn.com/carto-vl/assets/stations.geojson')
.then(response => response.json())
.then(function(data){
console.log(data);
// Define layer
const source = new carto.source.GeoJSON(data);
const viz = new carto.Viz();
const layer = new carto.Layer('layer', source, viz);

layer.addTo(map, 'watername_ocean');
layer.on('loaded', hideLoader);
});

})
.catch(error => console.error('Error:', error));
function hideLoader() {
document.getElementById('loader').style.opacity = '0';
}
</script>
</body>
</html>
8 changes: 2 additions & 6 deletions examples/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"title": "Add CARTO dataset layer",
"file": "basics/add-layer.html"
},
{
"title": "Add GeoJSON layer",
"file": "basics/add-layer-geojson.html"
},
{
"title": "Style layer",
"file": "basics/basic-style.html"
Expand Down Expand Up @@ -118,8 +114,8 @@
"title": "Advanced",
"samples": [
{
"title": "Denver trees",
"file": "advanced/denver-trees.html"
"title": "External GeoJSON layer",
"file": "advanced/external-geojson.html"
},
{
"title": "US population by county",
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1 class="page-title">CARTO <span style="color:#0095dd;">VL</span></h1>
<ul style="margin:24px;">
<li><h3><a href="docs/public">API docs</a></h3></li>
<li><h3><a href="examples">Examples</a></h3></li>
<li><h3><a href="examples/editor/index.html">Interactive example</a></h3></li>
<li><h3><a href="examples/editor/index.html">Interactive editor</a></h3></li>
<li><h3><a href="https://github.com/CartoDB/carto-vl">GitHub repository</a><h3></li>
</ul>
</body>
Expand Down
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,17 @@
"s3": "^4.4.0",
"serve": "^7.2.0",
"sloc": "^0.2.0",
"svg-inline-loader": "^0.8.0",
"uglifyjs-webpack-plugin": "^1.2.7",
"webpack": "^4.0.0",
"webpack-cli": "^2.1.4",
"webpack-glsl-loader": "^1.0.1"
},
"module": "carto-vl.js",
"main": "carto-vl.js",
"jsnext:main": "carto-vl.js",
"module": "dist/carto-vl.js",
"main": "dist/carto-vl.js",
"scripts": {
"prepublish": "yarn build:npm",
"prepublish": "yarn build",
"build": "yarn build:dev && yarn build:min",
"build:npm":"yarn build:npm:dev && yarn build:npm:min",
"build:npm:dev": "webpack --config webpack/webpack.config.js --output-path='./'",
"build:npm:min": "webpack --config webpack/webpack.min.config.js --output-path='./'",
"build:dev": "webpack --config webpack/webpack.config.js",
"build:min": "webpack --config webpack/webpack.min.config.js",
"build:watch": "webpack -w --config webpack/webpack.config.js",
Expand All @@ -87,10 +85,10 @@
"test:user:watch": "karma start --no-single-run --auto-watch --browsers ChromeHeadlessNoSandbox test/integration/user/karma.conf.js",
"test:user:watchc": "karma start --no-single-run --browsers Chrome test/integration/user/karma.conf.js",
"test:browser": "karma start --no-single-run --browsers Chrome test/unit/karma.conf.js",
"test:render": "yarn build:dev && mocha test/integration/render/render.test.js",
"test:render": "yarn build:dev && mocha test/integration/render/render.test.js --timeout 5000",
"test:render:clean": "rm -rf test/integration/render/scenarios/**/**/reference.png",
"test:render:prepare": "yarn build:dev && node test/integration/render/render.prepare.js ",
"test:e2e": "yarn build:dev && mocha test/acceptance/e2e.test.js",
"test:e2e": "yarn build:dev && mocha test/acceptance/e2e.test.js --timeout 10000",
"test:e2e:clean": "rm -rf test/acceptance/e2e/**/reference.png",
"test:e2e:prepare": "yarn build:dev && node test/acceptance/e2e.prepare.js ",
"test:benchmark": "node test/benchmark/benchmark.js",
Expand Down
Loading

0 comments on commit 46186bb

Please sign in to comment.