I am upgrading javascript here maps to version 3.1. While replacing few old methods with new ones, there is one method which is not working in v3.1. The method is
var oldStrip = polygon.getStrip(); //polygon.getStrip() is the old version method
var pntcnt = oldStrip.getPointCount();
When I replaced polygon.getStrip();
with polygon.getGeometry();
and the further code is as it is -
var oldStrip = polygon.getGeometry();
var pntcnt = oldStrip.getPointCount();
i get the following error as - Uncaught TypeError: oldStrip.getPointCount is not a function
Note - The response of polygon.getStrip() is different than that of polygon.getGeometry()
Any help is appreciated, TIA
var oldStrip = polygon.getGeometry();
If oldStrip is H.geo.Polygon, you can use its method getExterior to obtain the exterior ring of the polygon (H.geo.LineString) and then its getPointCount method which returns the number of points stored in this LineString.
oldStrip.getExterior().getPointCount();
If oldStrip has interior rings, you need to use its method getInteriors to calculate the number of points for all of them.
If oldStrip is H.geo.MultiPolygon, you need to repeat step 1 for each polygon in the collection.