slms4redd / portal

SFMS web portal client improved
http://nfms4redd.org
1 stars 2 forks source link

OpenLayers max zoom level not configured #6

Closed alessio-alfonsetti closed 8 years ago

alessio-alfonsetti commented 9 years ago

The Max Zoom Level is not configured. If the users zooms in to the map over a certain level the background map gets stuck and it is required to re load the portal in order to be navigate it again.

minotogna commented 9 years ago

This future was not existent in the 2 current portal implementations and Max Zoom does not exist in open layers.

I have added map.options to the plugin.conf in order to set the desired map options.

Please see the open layers documentation to see what options are available. http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html In your case, you might want to see minScale, maxScale.

Best, Mino

alessio-alfonsetti commented 9 years ago

The portal.properties has to be provided with the following configuration options for OpenLayers:

The "core" module has to be modified to add the configuration logic to pick up the configuration parameters from the /default_config/portal.properties configuration file and set the OpenLayers variables - particularly, the following classes have to be modified:

minotogna commented 9 years ago

Hi Alessio, If i understand correctly, these parameters can be set in the map.options With the current implementation you can add these settings to plug-in conf file. Have you tried it? Regards Mino On Aug 10, 2015 16:51, Alessio notifications@github.com wrote:

Reopened

6.

— Reply to this email directly or view it on GitHub.

alessio-alfonsetti commented 9 years ago

"With the current implementation you can add these settings to plug-in conf file"

I tried it. They get ignored because there is no any logic on the Config / DefaultConfig classes to get them and set them for OpenLayers. Working on it now.

minotogna commented 9 years ago

I'm not sure I understand. OpenLayers is a javascript api, the config classes you are talking about are on the server side. They get ignored where? By the map.js script? Mino On Aug 10, 2015 5:23 PM, Alessio notifications@github.com wrote:

"With the current implementation you can add these settings to plug-in conf file" I tried it. They get ignored because there is no any logic on the Config / DefaultConfig classes to get them and set them for OpenLayers. Working on it now. — Reply to this email directly or view it on GitHub.

minotogna commented 9 years ago

I added the options for the map in the demo conf file: https://github.com/slms4redd/portal/blob/master/demo/src/main/webapp/WEB-INF/default_config/plugin-conf.json And they work for me. Can you please provide a test case? Thank you Mino On Aug 10, 2015 4:51 PM, Alessio notifications@github.com wrote:

The portal.properties has to be provided with the following configuration options for OpenLayers: maxResolution maxExtent The "core" module has to be modified to add the configuration logic to pick up the configuration parameters from the /default_config/portal.properties configuration file and set the OpenLayers variables - particularly, the following classes have to be modified: Config DefaultConfig ConfigServlet — Reply to this email directly or view it on GitHub.

alessio-alfonsetti commented 9 years ago

Thanks Mino! It is working. Now we have a situation where it is possible to configure the OpenLayers.Map object from:

Shall we fix it and have a cleanest solution with only one file to provide OpenLayers.Map configuration?

Anybody, please correct the statement if it should be wrong, for documentation's sake.

minotogna commented 9 years ago

Thanks Alessio! I repeat, IT WAS ALREADY WORKING.

If you read the first comment on this task, you COULD SET those properties, as well as all map properties, in the plugin-conf ( map.options ).

With your updates, these properties can now be set in two different parts.

Also, I'm trying to follow a modular approach , so if you think about it, logically makes more sense to set these properties to the map.options, because they are MAP properties, and NOT general portal settings.

I dont understand why you didn't want to discuss this and keep ignoring my comments.

Regards, Mino

alessio-alfonsetti commented 9 years ago

Mino,

The two ways to configure the properties are already set on the portal the way it is. I am not ignoring your comments! All I am doing is approaching a portal that I have never seen before, trying to understand how it is designed in order to get into the way of thinking of whoever has been working on it so far in total absence of documentation. I am following your comments, but some OpenLayers,Map options are not working. It may be because the way OpenLayers has been deployed. Keep writing here notes, comments and suggestions is only a way to have a sort of documentation for whoever comes after me.

I would keep personal comments for other channels. Alessio

minotogna commented 9 years ago

Alessio,

I apologize if I seemed unkind, it was not my intention at all. However it was difficult to understand the problem without having a test case.

Regarding the documentation i might agree with you, but , in my opinion, we should probably expand this concept a bit more and with the team.

Mino

alessio-alfonsetti commented 9 years ago

I am sorry Mino. My fault. The documentation of the issue was not proper especially cause I meant to solve it myself and provide better description with the solution.

I will do so soon.

minotogna commented 9 years ago

Hi Alessio,

no-one fault, i think only a problem of communication (from my side for sure).

I think that now i could understand the problem better: is it because the option you want to set is not of a primitive type? In that case, it's a bug in the solution i provided, and i think i found the fix. If you want, you can test it with the master branch, The line of code i added to map.js is: var configValue = eval( config.options[ optName ]);

In that case, also objects can be set to map.option like: {"scales": [50000000, 30000000, 10000000, 5000000], "resolutions": [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125], "minScale": 50000000, "maxResolution": "auto", "maxExtent": "new OpenLayers.Bounds(-180, -90, 180, 90)", "maxResolution": 0.17578125, "maxScale": 10000000, "minResolution": "auto", "minExtent": "new OpenLayers.Bounds(-1, -1, 1, 1)", "minResolution": 0.0439453125, "numZoomLevels": 5}

I anyway want to give the possibility to add those map options in one place (plugin-conf.properites), so that the developer decides whether put the config in one place or (for backwards compatibility) leave that in the portal.properties.

Please let me know if it makes sense.

Thank you, Mino

Damianofds commented 8 years ago

I used the map object in plugin-conf.json and it works like a charm, min and max scale are configurable along with the number of zoom levels as well as the map extent.

Since the properties specified in the old portal.properties aren't used anymore I deleted them, it was weird to use a propeties file to configure a client side thing and the plugin-conf.json looks to me a suitable place.

I think we can defintelly close this issue.