camptocamp / c2cgeoportal

c2cgeoportal application
http://geomapfish.org
Other
64 stars 46 forks source link

Recenter on coordinates - Does not work anymore with WGS84 #1956

Closed gnerred closed 8 years ago

gnerred commented 8 years ago

From 1.6, it is not possible anymore to recenter map on WGS84 coordinates using the search bar. With LV03 coordinates it works. Can be tested on

http://map.cartoriviera.ch

With 554171 146114 (OK)

And 6.84165 46.46493 (not OK)

Problem of GMF or configuration missing on my application ? Thanks

kalbermattenm commented 8 years ago

I think this is only due to some missing configuration... on http://sitn.ne.ch, it is still possible...

Coming back to you with some conf... I just have to search in our code ;-)

kalbermattenm commented 8 years ago

Check this line https://github.com/camptocamp/sitn_c2cgeoportal/blob/1.6/sitn/templates/viewer.js#L813

I do not know if it is this one which you are missing...

gnerred commented 8 years ago

Thanks @kalbermattenm . Do you have 1.6 on sitn.ne.ch ? I checked my viewer.js, and I have the line you mention...

gnerred commented 8 years ago

And I also have showCenter: true, but not symbol is shown when recentering, nor on sitn.ne.ch

kalbermattenm commented 8 years ago

Yes... (1.6.7rc6)

gnerred commented 8 years ago

Has someone of C2C an idea of the problem ?

FYI, if I enter 560670 145330 in search bar, no server request is send, only JS handels the recentering. If I enter 6.92669 46.45814, a FTS request is send, so it is not considered by the plugin to be a coordinates pair. Thanks

ochriste commented 8 years ago

this line return null in your project: https://github.com/camptocamp/cgxp/blob/1.6/core/src/script/CGXP/widgets/FullTextSearch.js#L163

I will see if I can find why

kalbermattenm commented 8 years ago

And I also have showCenter: true, but not symbol is shown when recentering, nor on sitn.ne.ch

@gnerred, yes... same problem on http://sitn.ne.ch

ochriste commented 8 years ago

projectionCodes: ... must be set in your map config, not in the fulltextsearch config

https://github.com/camptocamp/demo_geomapfish/blob/1.6/demo/templates/viewer.js#L479

kalbermattenm commented 8 years ago

OK... but then, why does that work on http://sitn.ne.ch ?

In this project the projectionCodes are also defined in the fulltextsearch config, and not in the map config..

gnerred commented 8 years ago

Thanks @ochriste , now it works !

Any idea about the other problem (showCenter) ?

kalbermattenm commented 8 years ago

I just tried to add projection 2056 to the fulltextsearch...

If I do not add them to: fulltextsearch -> widgetOptions -> projectionCodes, then it does not work.

And adding them to the map config (or not) does not change a thing...

There is something I do not get...

gnerred commented 8 years ago

Maybe those projections are added somewhere else in your code ?

kalbermattenm commented 8 years ago

See https://github.com/camptocamp/sitn_c2cgeoportal/pull/1114

Maybe those projections are added somewhere else in your code ?

Hmmm... I search for them... but I can only see them over there...

gnerred commented 8 years ago

@kalbermattenm , I think I can close this issue, as the original problem is solved. Ok for you ?

kalbermattenm commented 8 years ago

Yes, close it