sothawo / mapjfx

JavaFX implementation of a map using OpenLayers and JavaFX
http://www.sothawo.com/projects/mapjfx/
Apache License 2.0
111 stars 30 forks source link

[Suggestion]: specific numbers for zooming #85

Closed oosam2 closed 4 years ago

oosam2 commented 4 years ago

Hi again XD

I have my own map server [GeoServer] with Caching

the problem I am worried from clients when they use my map server for discover the world and not focus for what my app work for it that make the load of my server high when start Caching for new places It affects other clients

if you can specific numbers for zooming

for example mapView.setSpecificZoom(5, 11, 12, 15, 17);

for this example I specific 5 levels of zoom It is a simple attempt to reduce clients' server load

thank you

sothawo commented 4 years ago

You mean I should restrict the library to only 5 different zoom levels? I won't do that. I you have a server and have problems with client putting too much load on it, then you should throttle the access of your clients, limit the rate at which they download or limit the number of calls a client can make in a specific time window.

If I were to implement this, I would restrict all users of the library to these zoom levels, without consideration if they zoom/pan a lot, what map providers they use etc.

oosam2 commented 4 years ago

:( I'm not good enough with English hahahaha

what you have in the library just mapView.setZoom(14);

my Suggestion is add another methods not replacing mapView.setZoom(14);

public void setSpecificZoom(int...zoom) {
}

public void enableSpecificZoom() {
}

public void disableSpecificZoom() {
}

so when the client use the scroll mouse up down or double-click It only moves between int array zoom when I enabled the specific zoom

I hop my explaining is good

:)

sothawo commented 4 years ago

OpenLayers allows to set the min or max zoom level, but not a restriction on intermediate levels. So there is no way to enforce that.