Move new examples to site/src/examples
This commit is contained in:
@@ -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
|
|
||||||
})
|
|
||||||
});
|
|
||||||
@@ -14,7 +14,7 @@ module.exports = {
|
|||||||
resolve: 'gatsby-source-filesystem',
|
resolve: 'gatsby-source-filesystem',
|
||||||
options: {
|
options: {
|
||||||
name: 'examples',
|
name: 'examples',
|
||||||
path: path.join(__dirname, '..', 'new-examples')
|
path: path.join(__dirname, 'src', 'examples')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ exports.createPages = async (
|
|||||||
frontmatter: markdownNode.frontmatter,
|
frontmatter: markdownNode.frontmatter,
|
||||||
embedUrl: `/${embedDirName}/${embedName}`,
|
embedUrl: `/${embedDirName}/${embedName}`,
|
||||||
html: markdownNode.html,
|
html: markdownNode.html,
|
||||||
js: source.replace(/'\.\.\/src\/(.*?)\.js/g, "'$1"),
|
js: source.replace(/'\.\.\/\.\.\/\.\.\/src\/(.*?)\.js/g, "'$1"),
|
||||||
css: exampleCss
|
css: exampleCss
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
import Map from '../../../src/ol/Map.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../../../src/ol/View.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../../../src/ol/format/GeoJSON.js';
|
||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {
|
||||||
import {BingMaps, Vector as VectorSource} from '../src/ol/source.js';
|
Tile as TileLayer,
|
||||||
import {Style, Stroke} from '../src/ol/style.js';
|
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({
|
const map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
@@ -16,7 +19,8 @@ const map = new Map({
|
|||||||
new VectorLayer({
|
new VectorLayer({
|
||||||
source: new VectorSource({
|
source: new VectorSource({
|
||||||
format: new GeoJSON(),
|
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,
|
opacity: 0.5,
|
||||||
style: new Style({
|
style: new Style({
|
||||||
@@ -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
|
||||||
|
})
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user