Skip to content

Commit bf1ee63

Browse files
Merge pull request #136 from jonataswalker/ol-pkg
Remove openlayers and add ol
2 parents 207592d + 4cdd383 commit bf1ee63

File tree

9 files changed

+409
-1018
lines changed

9 files changed

+409
-1018
lines changed

.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@ module.exports = {
33
rules: {
44
'no-console': 1
55
},
6-
globals: {
7-
ContextMenu: true,
8-
ol: true,
9-
},
106
};

build/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import uglify from 'rollup-plugin-uglify';
1111

1212
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'));
1313
const external = Object.keys(pkg.dependencies);
14+
external.push('ol/control/control');
1415

1516
const globals = {
16-
openlayers: 'ol',
17+
'ol/control/control': 'ol.control.Control',
1718
};
1819

1920
const lintOpts = {

examples/contextmenu.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</head>
1010
<body>
1111
<div id="map" tabindex="0"></div>
12-
<script src="https://unpkg.com/openlayers@4.4.2"></script>
12+
<script src="https://unpkg.com/openlayers"></script>
1313
<script src="./../dist/ol-contextmenu.js"></script>
1414
<script src="contextmenu.js"></script>
1515
</body>

examples/contextmenu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global ol, ContextMenu */
12
var view = new ol.View({ center: [0, 0], zoom: 4 }),
23
vectorLayer = new ol.layer.Vector({ source: new ol.source.Vector() }),
34
baseLayer = new ol.layer.Tile({ source: new ol.source.OSM() }),
@@ -69,11 +70,12 @@ contextmenu.on('open', function (evt) {
6970
});
7071

7172
map.on('pointermove', function (e) {
72-
if (e.dragging) return;
7373

7474
var pixel = map.getEventPixel(e.originalEvent);
7575
var hit = map.hasFeatureAtPixel(pixel);
7676

77+
if (e.dragging) return;
78+
7779
map.getTargetElement().style.cursor = hit ? 'pointer' : '';
7880
});
7981

0 commit comments

Comments
 (0)