Reputation: 927
I'm trying to create an SVG polygon from with Javascript.
When I try to creating an SVGPoint with this Javascript code:
var p = new SVGPoint();
I'm getting the following message: - TypeError: Illegal constructor
Upvotes: 8
Views: 9130
Reputation: 7112
Also you can try to use Raphaël javascript library that implement alternative SVG API and can emulate SVG in InternetExplorer 6+: http://raphaeljs.com/
Upvotes: -3
Reputation: 630627
From your SVG document you need to call .createSVGPoint()
to create a new point (initlaized at 0,0
), like this:
var p = svgRoot.createSVGPoint();
SVGPoint
(the interface itself) has no constructor, that's why you're getting an error currently.
Upvotes: 13