Use document.getElementById in examples.
Previously examples would either use the now deprecated `window.$` or the non-API-method `OpenLayers.Util.getElement`. This was well caught by @probins and @elemoine.
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
<script type="text/javascript">
|
||||
var map, drawControls;
|
||||
|
||||
var $ = OpenLayers.Util.getElement;
|
||||
|
||||
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
@@ -36,10 +34,10 @@
|
||||
});
|
||||
vectors.events.on({
|
||||
'featureselected': function(feature) {
|
||||
$('counter').innerHTML = this.selectedFeatures.length;
|
||||
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||
},
|
||||
'featureunselected': function(feature) {
|
||||
$('counter').innerHTML = this.selectedFeatures.length;
|
||||
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user