Skip to content

Commit

Permalink
Keep points the same pixel size on zoom.
Browse files Browse the repository at this point in the history
Ideally this would be an option that multiple renderers could honor.
  • Loading branch information
manthey committed Oct 30, 2018
1 parent d4a5cdb commit a8686f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/vtkjs/pointFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions src/vtkjs/vtkjsRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

/**
Expand Down

0 comments on commit a8686f7

Please sign in to comment.