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

Allows to have SVG URL #4993

Merged
merged 1 commit into from Jul 10, 2019
Merged

Allows to have SVG URL #4993

merged 1 commit into from Jul 10, 2019

Conversation

Copy link
Contributor

@pfirpfel pfirpfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I then test it in ngeo using "make serve-gmf-apps", I get this:
GET https://localhost:3000/contribs/gmf/apps/image/crosshair.svg?url 404 (Not Found)

So it's not really webpack, that's resolving the path, the browser itself does it. In a proper GMF installation, thanks to the URL-rewriting, you can access the same interface with different URL. I think there is no way around an absolute path, preferably coming from the python part.

contribs/gmf/apps/desktop_alt/image/logo.svg Outdated Show resolved Hide resolved
@sbrunner
Copy link
Member Author

sbrunner commented Jul 5, 2019

Yes It's also possible to use the python URL resolver with the following config:
interfaces_config.<interface>.static: <package>_geoportal:static/images/img.svg

For me booth should work...

@sbrunner
Copy link
Member Author

sbrunner commented Jul 5, 2019

I just fixed the issue :-)

@pfirpfel
Copy link
Contributor

pfirpfel commented Jul 5, 2019

Using this branch, I used make serve-gmf-apps and opened this url:
https://localhost:3000/contribs/gmf/apps/desktop_alt.html?map_x=643288&map_y=193988&map_crosshair=true

No crosshair for me.

The browser requests this:

https://localhost:3000/contribs/gmf/apps/%3Csvg%20viewBox=%220%200%2022%2022%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d=%22M10.963.4A2.5%202.5%200%200%200%208.5%202.935v5.55H2.95a2.5%202.5%200%201%200%200%205H8.5v5.554a2.5%202.5%200%201%200%205%200v-5.553h5.55a2.5%202.5%200%201%200%200-5H13.5v-5.55A2.5%202.5%200%200%200%2010.963.4z%22%20color=%22

This is https://localhost:3000/contribs/gmf/apps/plus the beginning of the svg.

@sbrunner
Copy link
Member Author

sbrunner commented Jul 5, 2019

Do you use the latest version?
With the dev server it's normal that you don't have the icon, but you should have a 404 error on the svg file...

@pfirpfel
Copy link
Contributor

pfirpfel commented Jul 5, 2019

Yes, I just tried again. Now it is just a 404

@sbrunner
Copy link
Member Author

sbrunner commented Jul 5, 2019

:-)

@sbrunner sbrunner force-pushed the svg-url branch 2 times, most recently from 89ecf05 to e711d79 Compare July 5, 2019 15:20
@sbrunner
Copy link
Member Author

sbrunner commented Jul 5, 2019

Fill also fix: #4940

@sbrunner sbrunner force-pushed the svg-url branch 4 times, most recently from 70d9352 to e860e82 Compare July 8, 2019 15:11
Copy link
Member

@gberaudo gberaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would rather avoid using SVGs than to have this SVG loader.
I added some small comments, otherwise LGTM.

buildtools/svg-viewbox-loader.js Show resolved Hide resolved
contribs/gmf/apps/desktop_alt/Controller.js Show resolved Hide resolved
examples/svg.html Outdated Show resolved Hide resolved
@@ -0,0 +1,98 @@
// Initially get from https://github.com/tildeio/simple-html-tokenizer/blob/v0.1.1/lib/simple-html-tokenizer/generator.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give a clearer filename?

Copy link
Member Author

@sbrunner sbrunner Jul 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like generate-html-from-tockens.js ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate-xml-from-tokens.js

Add an SVG to permalik crosshair

Add an included logo

Remove no more existing

Add example
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

Successfully merging this pull request may close these issues.

None yet

3 participants