diff --git a/new-examples/map.js b/new-examples/map.js deleted file mode 100644 index 6f015b08ce..0000000000 --- a/new-examples/map.js +++ /dev/null @@ -1,17 +0,0 @@ -import Map from '../src/ol/Map.js'; -import View from '../src/ol/View.js'; -import TileLayer from '../src/ol/layer/Tile.js'; -import OSM from '../src/ol/source/OSM.js'; - -const map = new Map({ - layers: [ - new TileLayer({ - source: new OSM() - }) - ], - target: 'map', - view: new View({ - center: [0, 0], - zoom: 1 - }) -}); diff --git a/site/gatsby-config.js b/site/gatsby-config.js index 9547961526..251aea0654 100644 --- a/site/gatsby-config.js +++ b/site/gatsby-config.js @@ -14,7 +14,7 @@ module.exports = { resolve: 'gatsby-source-filesystem', options: { name: 'examples', - path: path.join(__dirname, '..', 'new-examples') + path: path.join(__dirname, 'src', 'examples') } }, { diff --git a/site/plugins/examples/gatsby-node.js b/site/plugins/examples/gatsby-node.js index fa5148f55f..3330e4a1b9 100644 --- a/site/plugins/examples/gatsby-node.js +++ b/site/plugins/examples/gatsby-node.js @@ -181,7 +181,7 @@ exports.createPages = async ( frontmatter: markdownNode.frontmatter, embedUrl: `/${embedDirName}/${embedName}`, html: markdownNode.html, - js: source.replace(/'\.\.\/src\/(.*?)\.js/g, "'$1"), + js: source.replace(/'\.\.\/\.\.\/\.\.\/src\/(.*?)\.js/g, "'$1"), css: exampleCss } }); diff --git a/new-examples/.eslintrc b/site/src/examples/.eslintrc similarity index 100% rename from new-examples/.eslintrc rename to site/src/examples/.eslintrc diff --git a/new-examples/layers.js b/site/src/examples/layers.js similarity index 53% rename from new-examples/layers.js rename to site/src/examples/layers.js index e5d6b5d5f5..7dc5847e12 100644 --- a/new-examples/layers.js +++ b/site/src/examples/layers.js @@ -1,9 +1,12 @@ -import Map from '../src/ol/Map.js'; -import View from '../src/ol/View.js'; -import GeoJSON from '../src/ol/format/GeoJSON.js'; -import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js'; -import {BingMaps, Vector as VectorSource} from '../src/ol/source.js'; -import {Style, Stroke} from '../src/ol/style.js'; +import Map from '../../../src/ol/Map.js'; +import View from '../../../src/ol/View.js'; +import GeoJSON from '../../../src/ol/format/GeoJSON.js'; +import { + Tile as TileLayer, + Vector as VectorLayer +} from '../../../src/ol/layer.js'; +import {BingMaps, Vector as VectorSource} from '../../../src/ol/source.js'; +import {Style, Stroke} from '../../../src/ol/style.js'; const map = new Map({ layers: [ @@ -16,7 +19,8 @@ const map = new Map({ new VectorLayer({ source: new VectorSource({ format: new GeoJSON(), - url: 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json' + url: + 'https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json' }), opacity: 0.5, style: new Style({ diff --git a/new-examples/layers.md b/site/src/examples/layers.md similarity index 100% rename from new-examples/layers.md rename to site/src/examples/layers.md diff --git a/site/src/examples/map.js b/site/src/examples/map.js new file mode 100644 index 0000000000..688a22811d --- /dev/null +++ b/site/src/examples/map.js @@ -0,0 +1,17 @@ +import Map from '../../../src/ol/Map.js'; +import View from '../../../src/ol/View.js'; +import TileLayer from '../../../src/ol/layer/Tile.js'; +import OSM from '../../../src/ol/source/OSM.js'; + +const map = new Map({ + layers: [ + new TileLayer({ + source: new OSM() + }) + ], + target: 'map', + view: new View({ + center: [0, 0], + zoom: 1 + }) +}); diff --git a/new-examples/map.md b/site/src/examples/map.md similarity index 100% rename from new-examples/map.md rename to site/src/examples/map.md