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:
Marc Jansen
2012-05-29 21:47:22 +02:00
parent 042ad8d711
commit acb9f950df
11 changed files with 51 additions and 69 deletions

View File

@@ -34,8 +34,6 @@
<script type="text/javascript">
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
var $ = OpenLayers.Util.getElement;
function init() {
initMap();
initUI();
@@ -196,7 +194,7 @@
* property values.
*/
function initUI() {
var check = $("snapping");
var check = document.getElementById("snapping");
check.checked = true;
check.onclick = function() {
if(check.checked) {
@@ -206,7 +204,7 @@
}
};
var sel = $("editable");
var sel = document.getElementById("editable");
sel.value = "poly";
sel.onchange = function() {
updateEditable(sel.value);
@@ -218,12 +216,12 @@
target = snap.targets[i];
for(var j=0; j<types.length; ++j) {
type = types[j];
tog = $(i + "_" + type);
tog = document.getElementById(i + "_" + type);
tog.checked = target[type];
tog.onclick = (function(tog, type, target) {
return function() {target[type] = tog.checked;}
})(tog, type, target);
tol = $(i + "_" + type + "Tolerance");
tol = document.getElementById(i + "_" + type + "Tolerance");
tol.value = target[type + "Tolerance"];
tol.onchange = (function(tol, type, target) {
return function() {