Update polygon.class.js

Correct polygon creation