Sha256: 385f2f2f082940f90fe0a3f1affe356b474c7b0648a95b01585a66f434a100b9
Contents?: true
Size: 1.01 KB
Versions: 12
Compression:
Stored size: 1.01 KB
Contents
// Requires: /// 0. nodejs // 1. jsdom installed (npm install jsdom) // 2. A build profile with mockdom.js included in [first], and node.js // inclded in [last], at ../../build/OpenLayers.js , like node-tests.js. // 3. Run with node run-tests.js // // Missing: integration with a solid node.js testrunner. var jsdom = require('jsdom'); jsdom.env('<html><body></body></html>', function(errors, window) { for (var i in window) { if (i == "console") { continue; } eval(i+"=window['"+i+"'];"); } OpenLayers = require("../../build/OpenLayers.js")['OpenLayers']; var map = new OpenLayers.Map(document.createElement("map")); map.addLayer(new OpenLayers.Layer("", {isBaseLayer:true})); map.setCenter(new OpenLayers.LonLat(-71,42), 10); var px = map.getPixelFromLonLat(map.getLonLatFromPixel(new OpenLayers.Pixel(100,100))); console.log(px); var px = map.getLonLatFromPixel(map.getPixelFromLonLat(new OpenLayers.LonLat(10,10))); console.log(px); });
Version data entries
12 entries across 12 versions & 2 rubygems