camptocamp / ngeo

Library combining OpenLayers and AngularJS
https://camptocamp.github.io/ngeo/master/examples
MIT License
135 stars 87 forks source link

Generated URLs of theme selector are not correct #520

Closed tsauerwein closed 8 years ago

tsauerwein commented 8 years ago

Open https://camptocamp.github.io/ngeo/master/examples/contribs/gmf/themeselector.html The URL is changed to https://camptocamp.github.io/ngeo/master/examples/contribs/gmf/themeselector.html/theme/Transport

Now when doing a refresh, you get 404.

Same for the mobile application.

sbrunner commented 8 years ago

Same for the mobile application.

?? it's the mobile application, not?

tsauerwein commented 8 years ago

Sorry, the first link should have pointed to https://camptocamp.github.io/ngeo/master/examples/contribs/gmf/themeselector.html

sbrunner commented 8 years ago

Should we be able to disable this feature in the examples? Or using https://github.com/jekyll/jekyll-redirect-from?

tsauerwein commented 8 years ago

IMHO the URLs should be generated in a way that they work without having to define an Apache rewrite or some other module to rewrite the URL. E.g. they also do not work with localhost:3000 in dev mode.

sbrunner commented 8 years ago

It's a feature for GeoMapFish in full, than it's normal that's without c2cgeoportal we should do something to make it working!

tsauerwein commented 8 years ago

That doesn't mean we should add unneeded complexity and requirements. E.g. changing the URL from ".../themeselector.html/theme/Transport" to "themeselector.html#theme/Transport" would already solve the issue.

sbrunner commented 8 years ago

But it's breaks backward compatibility ...

tsauerwein commented 8 years ago

Does it? The theme selector directive was added last week.

fgravin commented 8 years ago

I wonder if we cannot configure github.io to manage this kind of url ? It is a HTML5 url pattern.

For example i remember i needed to add a .nojekyll file in my gh-pages to make some pages work in github.io, maybe there is something similar..

sbrunner commented 8 years ago

@tsauerwein backward compatibility with previous version of GeoMapFish!

fgravin commented 8 years ago

I think this issue affects everyone. We can stay like that, or we can try to solve it. One option I see as mentionned @tsauerwein is to use the # symbol. For the backward compatibility, we can manage it web server side, just add the hash with a redirect or rewrite rule.

This would imply to rely on angular $location service, and to remove the ngeoLocation we got from Luxembourg.

fredj commented 8 years ago

And do we really want to use # to store the theme? What about using map_theme=foo as it's done for the position and base layer?

fgravin commented 8 years ago

And do we really want to use # to store the theme? What about using map_theme=foo as it's done for the position and base layer?

This would be the easiest way to proceed indeed

sbrunner commented 8 years ago

But as I already say we needs this functionality in GeoMapFish!

fgravin commented 8 years ago

Yes but how geomapfish handles this kind of path ?? There must be a server rule, so we could update this rule.

sbrunner commented 8 years ago

It's not the question, I'm pretty sure that the UserGroup want this feature like it's now, than we can't change it without the PSC agreement.

ybolognini commented 8 years ago

see: https://github.com/camptocamp/c2cgeoportal/issues/2178

sbrunner commented 8 years ago

Fixed long time ago...