How to get and increase the average length of multiple marks?

I have a set of point labels positioned over a small area above the google earth plugin, how can I get the average power (bounding box) of a subset of these point labels and scale to that extent?

Best regards, Shiva

+3


source to share


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







All Articles