How to draw non-scalable circle in SVG with Javascript

后端 未结 4 1822
星月不相逢
星月不相逢 2020-12-16 20:51

I\'m developing a map, in Javascript using SVG to draw the lines.

I would like to add a feature where you can search for a road, and if the road is found, a circle a

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 20:54

    It's discussed here and here

    It looks like current browsers don't do the expected thing, so one needs to apply the inverse transform of the zoom (scale) on the contents of the , eg. transorm: scaleX(5) on the user of the etc. will need to be accompanied by a transform: translate(...) scaleX(0.2) inside the , also factoring in possible x/y/width/height/transform-origin values inside the pattern if needed

提交回复
热议问题