Sort by distance don't work

fix #4260: sort by distance doesn't work
(or, rather, in the object with the default constructor, "Such an object will never be used as a comparator because …") since the `newInstance()` will also create such an object.