You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there!
I try to build a library to use OpenLayers but I don’t know how (or if is possible to build like this)
in my page i use the following modules to build different apps
import {Map, View} from 'ol';
import VectorSource from 'ol/source/Vector.js';
import Feature from 'ol/Feature.js';
import {Stroke, Icon, Style} from 'ol/style.js';
import Point from 'ol/geom/Point.js';
import {Vector as VectorLayer} from 'ol/layer.js';
import Overlay from 'ol/Overlay.js';
import TileLayer from 'ol/layer/Tile.js';
import OSM from 'ol/source/OSM.js';
import {toLonLat, fromLonLat, transform} from 'ol/proj.js';
import {toStringXY} from 'ol/coordinate.js';
import Polyline from 'ol/format/Polyline.js';
Page1
export class Streetmap1{
// run map 1 use all modules
}
parcel build the above modules
function t(t){return t&&t.__esModule?t.default:t}var e=class{... the rest code
Page2
export class Streetmap2{
// run map 2 not use stroke, polyline
}
parcel build the above modules
let t,e,i;function n(t){return t&&t.__esModule?t.default:t}var s=class{... the rest code
Page3
export class Streetmam3{
// run map 3 not use stroke, polyline, toStringXY, toLonLat
}
parcel build the above modules
let t,p,i;function n(t){return t&&t.__esModule?t.default:t}var n=class{... the rest code
Of course, this is not the right way to do thinks, in every page i have to load different names/hashes to do the same operators!
What i like to do is to build a new library (keeping the original function/class names?) and to use as import.
for example, ideal will be to build new class Mymap to includes the libraries minified and to use as Mymap.Map, Mymap.Stroke etc.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there!
I try to build a library to use OpenLayers but I don’t know how (or if is possible to build like this)
in my page i use the following modules to build different apps
Page1
Page2
Page3
Of course, this is not the right way to do thinks, in every page i have to load different names/hashes to do the same operators!
What i like to do is to build a new library (keeping the original function/class names?) and to use as import.
for example, ideal will be to build new class Mymap to includes the libraries minified and to use as Mymap.Map, Mymap.Stroke etc.
Any idea how to do this?
Beta Was this translation helpful? Give feedback.
All reactions