Skip to content

Supporting custom types

Compare
Choose a tag to compare
@odlp odlp released this 28 Aug 11:22
· 10 commits to main since this release

The v0.3.0 release adds two features:

1. The original point is now returned in the optimised results.

This means additional data is preserved. For example, prior to this change attributes like note on this hash had not been returned:

{ x: 51.5256, y: -0.0875, note: 'My note' }

2. You can now use custom point objects, rather than just hashes.

Your custom points just need to respond to :x and :y, e.g:

CustomPointStruct = Struct.new(:id, :x, :y, :description)