bug fix in getLayerPoints