level2-gis / gisapp

Extended QGIS Web Client
GNU General Public License v3.0
53 stars 31 forks source link

Max zoom #80

Closed UnoRed1 closed 5 years ago

UnoRed1 commented 6 years ago

The maximum scale is 1: 282. How to do more?

I disabled the OSM layer in the Project table. This layer is not needed.

I tried to create an empty layer and set numZoomLevels. But it did not help. Infinite "LoadingMap" ...

uprel commented 6 years ago

I don't know what do you mean with empty layer. You have to put some data in QGIS project and reference it in database table projects. Some notes:

  1. If you have in database only qgis project without any base (or extra) layers then you can control numZoomLevels from client settings. https://github.com/uprel/gisapp/blob/8bd9279c8727ff9cb1ac94df2e19b4e3ae9c7fa4/client_common/settings-template.js#L24
  2. If you have infinite "Loading map" project is not loading, you need to debug this little. Try with Troubleshooting page
  3. If you add any base or extra (overlay) layer to project in database, then Map zoom levels are controlled by that layer(s) and numZoomLevels setting is irrelevant.
UnoRed1 commented 6 years ago

Eqwc.settings.numZoomLevels = 22; It works. Thanks!

UnoRed1 commented 6 years ago

Is it possible to limit the scale in the opposite direction to 1: 565?

I want to limit the maximum zoom of 1:71, and the minimum zoom is 1: 565.

uprel commented 6 years ago

It should, just put lower number

UnoRed1 commented 6 years ago

If set Eqwc.settings.numZoomLevels = 4;

The zoom range is from 1: 591995847 to 1: 73999481.

UnoRed1 commented 6 years ago

In the QWC in GlobalOptions.js there are such parameters: maxScale: 250, minScale: 80000,

Are there any similar parameters in EQWC?

uprel commented 6 years ago

It isn't, I will check reason and add it if needed. Did you set your start extent from QGIS project properties https://github.com/uprel/gisapp/wiki/5.1.-QGIS#ows-server---wms-capabilities And then set restrict_to_start_extent for that project in gisapp to true.

UnoRed1 commented 6 years ago

I set up the "Advertised extent" and set "Use layer ids as names" in the properties of the QGIS project. Then in the "projects" table, set "restrict_to_start_extent" = TRUE.

restrict_to_start_extent is working, but I still can zoom out far.

UnoRed1 commented 6 years ago

The ability to limit the scale will be useful. Please add this feature if possible.

uprel commented 6 years ago

Can you confirm whether you are using only qgis project and no baselayers from database.

UnoRed1 commented 6 years ago

I only use the QGIS project. I disabled baselayers in the "projects" table.

I have another second project that uses baselayer OSM.

UnoRed1 commented 6 years ago

I want to make the scale limit only for the first project.

uprel commented 6 years ago

To limit zoom out for projects without baselayers and with set restriction to start extent = true follow this:

  1. Set DEBUG mode to TRUE in settings.php

https://github.com/uprel/gisapp/blob/b96ca63af59bd72b6462d183bc7f1b70956cffe9/admin/settings_template.php#L15

  1. Open project in browser. In the first screen open Browser developers window with F12.
  2. In console window type geoExtMap.map.getResolution()
  3. Add new property to LayerOptions object in https://github.com/uprel/gisapp/blob/b96ca63af59bd72b6462d183bc7f1b70956cffe9/client/site/js/LoadAppProjectData.js#L291

Add maxResolution: VALUE FROM CONSOLE

UnoRed1 commented 6 years ago

It works, but in DEBUG mode on the map my vector layers from the PostgreSQL database are not displayed.

Do I need to update gisapp?

uprel commented 6 years ago

No, it should be working. Do you get any errors in console window (when you open developers window with F12)?

UnoRed1 commented 6 years ago

I rechecked.

I have two projects. One with the baselayer, the other without the baselayer.

I wanted to set maxScale/minScale for a project without a baselayer. It works well in Debug Mode. All layers are displayed.

But in a project where there is a baselayer, no other layers are displayed. Neither from PostgreSQL, nor from the disk.

In the browser console, only " util.js:229 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys " But this message appears in both cases. And when Debug mode is on and when it is off.

uprel commented 6 years ago

OK, so no errors. More possible reasons for your problem, but nr. 1 to check is that you must save your QGIS project in same coordinate system than your base layer (same EPSG code). You don't get errors for that but data is just not positioned correctly. Can you open table for your layers and see attributes or nothing? If nothing then maybe some permissions issue. Check Apache and PostgreSQL logs in that case.

UnoRed1 commented 6 years ago

The QGIS project is saved in EPSG: 3857. Baselayer - OSM_Mapnik. Attribute tables are opened - they contain data.

UnoRed1 commented 6 years ago

"Zoom to layer extent" does not work. As if the layers have become invisible.

uprel commented 6 years ago

And if you zoom to one of the feature from table. What happens?

Something is with your data. Check PostgreSQL log file for any errors

UnoRed1 commented 6 years ago

My layers are just invisible. On the screen only baselayer.

In postgresql.log: An existing connection was forcibly closed by the remote host.

But this message appears in both cases. And when it works and when it does not work.

uprel commented 6 years ago

OK, no errors also here. Still you have to explore this more to understand where is the problem. I would:

UnoRed1 commented 6 years ago

Excuse me. I did not understand. How to do this:

clear all cache here http://localhost/gisapp/admin/cache.php

uprel commented 6 years ago

Can you open this page? Just change localhost if necessary, to IP of your server. When page is opened, hit on top of page "Clear all cache"

uprel commented 5 years ago

Since commit 3123ca1ef0c944c2490fcefe452f793d2b64a0c7 restrict to start extent option will also block zooming out map. Workaround described above is not needed anymore. This will be included in release 1.8