Keep points the same pixel size on zoom.
Ideally this would be an option that multiple renderers could honor.
MODIFY
src/vtkjs/pointFeature.js
src/vtkjs/pointFeature.js
@@ -127,6 +127,12 @@ var vtkjs_pointFeature = function (arg) {
if (m_this.dataTime().getMTime() >= m_this.buildTime().getMTime() ||
m_this.updateTime().getMTime() < m_this.getMTime()) {
m_this._build();
+ } else {
+ var data = m_this.data(),
+ radFunc = m_this.style.get('radius'),
+ rad = radFunc(data[0], 0);
+ rad *= m_this.layer().map().unitsPerPixel(m_this.layer().map().zoom());
+ m_source.setRadius(rad);
}
m_this.updateTime().modified();

MODIFY
src/vtkjs/vtkjsRenderer.js
src/vtkjs/vtkjsRenderer.js
@@ -33,7 +33,7 @@ var vtkjsRenderer = function (arg) {
background: [0, 0, 0, 0]});
vtkRenderer.setContainer(m_this.layer().node().get(0));
// TODO: Is there a way to start with no interactor rather than unbinding it?
- vtkRenderer.getInteractor().unbindEvents()
+ vtkRenderer.getInteractor().unbindEvents();
vtkRenderer.resize();
var vtkjsren = vtkRenderer.getRenderer();
var renderWindow = vtkRenderer.getRenderWindow();
@@ -151,9 +151,8 @@ var vtkjsRenderer = function (arg) {
* produce a pan
*/
m_this.layer().geoOn(geo_event.pan, function (evt) {
- // TODO: If the zoom level has changed, our point size needs to be
- // recalculated, so we should call m_this._render
- // DO NOTHING
+ // TODO: We may only need to do this if the zoom level has changed.
+ m_this._render();
});
/**

Keep points the same pixel size on zoom.

Ideally this would be an option that multiple renderers could honor.