You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
Terraformer contains and within methods work only with Primitives, and doesn't work with Terraformer.Circle which is a Feature, so it's usage example in docs is confusing.
In the following example only within2 returns true;
var circle = new Terraformer.Circle([10, 10], 5000000, 64);
var rectanglePrimitive = new Terraformer.Polygon({
type: "Polygon",
coordinates: [[[-10, -10], [10, -10],
[10, 10], [-10, 10]]]
});
var contains = circle.contains(rectanglePrimitive);
var within = circle.within(rectanglePrimitive);
var contains2 = rectanglePrimitive.contains(circle.geometry);
var within2 = rectanglePrimitive.within(circle.geometry);
var contains3 = circle.contains(mapBounds);
var within3 = circle.within(mapBounds);
var contains4 = mapBounds.contains(circle.geometry);
var within4 = mapBounds.within(circle.geometry);
var contains5 = rectanglePrimitive.contains(circle);
var within5 = rectanglePrimitive.within(circle);
The text was updated successfully, but these errors were encountered:
Terraformer
contains
andwithin
methods work only withPrimitives
, and doesn't work withTerraformer.Circle
which is aFeature
, so it's usage example in docs is confusing.In the following example only
within2
returnstrue
;The text was updated successfully, but these errors were encountered: