Clearer function name for getting a render pixel
This commit is contained in:
+3
-3
@@ -3,7 +3,7 @@ import View from '../src/ol/View.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import {getPixelFromPixel} from '../src/ol/render.js';
|
||||
import {getRenderPixel} from '../src/ol/render.js';
|
||||
|
||||
const key = 'As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5';
|
||||
|
||||
@@ -51,8 +51,8 @@ container.addEventListener('mouseout', function() {
|
||||
// after rendering the layer, show an oversampled version around the pointer
|
||||
imagery.on('postrender', function(event) {
|
||||
if (mousePosition) {
|
||||
const pixel = getPixelFromPixel(event, mousePosition);
|
||||
const offset = getPixelFromPixel(event, [mousePosition[0] + radius, mousePosition[1]]);
|
||||
const pixel = getRenderPixel(event, mousePosition);
|
||||
const offset = getRenderPixel(event, [mousePosition[0] + radius, mousePosition[1]]);
|
||||
const half = Math.sqrt(Math.pow(offset[0] - pixel[0], 2) + Math.pow(offset[1] - pixel[1], 2));
|
||||
const context = event.context;
|
||||
const centerX = pixel[0];
|
||||
|
||||
Reference in New Issue
Block a user