lundi 30 mars 2015

Placing Icon/Image upon a SVG shape properly?

Hope you guys can give me some pointers to how this can be accomplished.


I have these Regions which is svg path´s. Each region here is an individual svg path: enter image description here


I then need to place an image/icon/text, anything really, inside these. It doesnt matter where, but somewhere middle ish. And that seems pretty easy, just take place it in the middle of the path tag, But no. A region like Japan here, would make an icon centered to it, appear in the middle of the water: enter image description here


So how do i place my image/icon on these svg paths, so thats its somewhat centered, AND within the region?


PS. These regions can be zoomed in on, and i can pan around. Its also random which regions will have this image/icon on them, so i cannot hardcode positions into this. Hope you understand.


Here you can see how the regions are looped out: enter image description here


Thanks a lot in advance


Aucun commentaire:

Enregistrer un commentaire