question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inherit min/max scale from service

See original GitHub issue

I think this makes a good ‘micro’ plugin candidate (as opposed to bolting it on to esri-leaflet-renderers) for a couple reasons

  1. minScale and maxScale are not part of the drawing options within the FeatureLayer metadata
  2. its trivial enough that it would be well suited as a reference in much needed plugin development documentation.

at the very least it would be cool to have a sample which shows how to retrieve the information using FeatureLayer.metadata().

featureLayer.metadata(function(error, metadata){
  // convert metadata.minScale to zoom level
  featureLayer.options.minZoom = minZoom
  featureLayer.addTo(map);
});

related: https://gis.stackexchange.com/questions/7430/what-ratio-scales-do-google-maps-zoom-levels-correspond-to/81390#81390

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
zachatrocitycommented, Jan 31, 2019

Great, thank you so much!

2reactions
jgravoiscommented, Jan 31, 2019

@zachatrocity no worries.

// use scale to calculate level
level = Math.log(591657550.500000 / scale) / Math.log(2) + 1

this is the inverse of the StackExchange formula i linked to earlier:

// use level to calculate scale
scale = 591657550.500000 / Math.pow(2, level - 1)

ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How does MinMaxScaler work - Scaled per row or ...
MinMaxScaler scales by column. Check the documentation, the scaling happens by taking min/max on the axis 0: (X - X.min(axis=0)) ...
Read more >
Inheritance Model | Framework Documentation - Kubestack
The practical examples below show how to use inheritance to scale cluster modules and cluster service modules per environment. Cluster modules. The scaling...
Read more >
Virtual Service Scaling - Avi Networks
Virtual services inherit from their SE group the values for the minimum and maximum number of SEs on which they can be instantiated....
Read more >
ScaleRangeSlider | ArcGIS Maps SDK for JavaScript 4.25
The ScaleRangeSlider widget allows the user to set a minimum and maximum scale based on named scale ranges. When a layer is provided...
Read more >
MinMaxScaleConstraint Class (Microsoft.MixedReality.Toolkit ...
Clamps the transform scale to the scale limits set by Microsoft.MixedReality.Toolkit.UI.MinMaxScaleConstraint.SetScaleLimits such that:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found