How to get and increase the average length of multiple marks?
1 answer
You should take a look at the GEARTExtensions library
In particular, the namespace GEarthExtensionsView and the computeBounds method. They will allow you to easily customize the view to a subset of your labels.
A simple example code for this would be something like:
var folder = gex.dom.addFolder([
gex.dom.buildPointPlacemark([37, -122]),
gex.dom.buildPointPlacemark([40, -79]),
gex.dom.buildPointPlacemark([25, -80])
]);
var bounds = gex.dom.computeBounds(folder);
gex.view.setToBoundsView(bounds, { aspectRatio: 1.0 });
Edit based on comment
If you read the documentation for the setToBoundsView method , you can see that the default range is 1000 meters. Therefore, if you are working on a smaller scale, just set a smaller value for the range in meters.
gex.view.setToBoundsView(bounds, { aspectRatio: 1, defaultRange: 200 });
+3
source to share