Closed Wulfheart closed 9 months ago
I'm not sure I understand, are you asking how to get the correct SVG, or how to render it?
Sorry for not phrasing it correctly. Is there a way to generate svg maps using go, not js? If so, how?
We only use Go to generate state in the shape of e.g. JSON objects that is then used to render using JS/CSS on WebViews or browsers.
It's a sad truth that SVG is a great format that is only really properly supported by browsers :/
@zond Thank you really much. I think I saw a project which renders them in Python but this massively increases the payload for the client. So rendering it in the browser may actually be beneficial.
One question: How do you calculate where to place the units? I understand that there province-centers and supply centers marked. But how do you calculate the offset? Any suggestions for this?
Browser or some kind of WebView, yeah.
We e.g. getElementById('lon_center'), and then use the location of that element as position (with some unit model based offset) for the unit.
Hm. Guess then I am going to do it that way too. Thank you. If I make significant progress I am going to post it here. As you might be interested in it.
Another question, sorry for spamming:
Why is the provinces
layer hidden and all provinces are shown when displaying this layer? Currently I am solving this by iterating over all provinces and hide them again if they are not needed but seems a little counterintuitive to me.
I don't remember :D
Related to https://github.com/zond/godip/issues/95
I saw that there is now also a map. How can I render the svg?