Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render map #178

Closed
Wulfheart opened this issue Dec 4, 2023 · 8 comments
Closed

Render map #178

Wulfheart opened this issue Dec 4, 2023 · 8 comments

Comments

@Wulfheart
Copy link
Contributor

Related to #95

I saw that there is now also a map. How can I render the svg?

@zond
Copy link
Owner

zond commented Dec 5, 2023

I'm not sure I understand, are you asking how to get the correct SVG, or how to render it?

@Wulfheart
Copy link
Contributor Author

Sorry for not phrasing it correctly.
Is there a way to generate svg maps using go, not js? If so, how?

@zond
Copy link
Owner

zond commented Dec 5, 2023

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 :/

@Wulfheart
Copy link
Contributor Author

@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?

@zond
Copy link
Owner

zond commented Dec 5, 2023

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.

@Wulfheart
Copy link
Contributor Author

Wulfheart commented Dec 5, 2023

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.

@Wulfheart Wulfheart reopened this Dec 5, 2023
@Wulfheart
Copy link
Contributor Author

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.

@zond
Copy link
Owner

zond commented Dec 5, 2023

I don't remember :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants