在红宝石中,我有#each_slice ...
var layer;
var latlngs;
var testCorner;
m.on(L.Draw.Event.CREATED, function (event) {
var type =event.layerType;
layer=event.layer;
var fourCorners = layer.getBounds();
latlngs=[fourCorners.getNorthWest(),fourCorners.getSouthEast()]
if(type ==='rectangle'){
var points = layer._latlngs;
layer.on('mouseover', function() {
alert(latlngs);
});
}
drawnItems.addLayer(layer);
});
我正在寻找一种优雅的方式来在Groovy中做到这一点,这是我初学者所能做到的一切:
latlngs[0]=40.889178
latlngs[1]=-83.659965
latlngs[3]=40.320629
latlngs[4]=-82.37693