在openlayers 3应用程序中,我能够检索边界范围并适合视图。但是我现在想要使用边界范围创建一个特征/多边形。
let boundingExtent = ol.extent.boundingExtent([[left, bottom], [right, top]]);
//??/let polygon = ol.geom.Polygon.fromExtent(boundingExtent);
var view = this.map.getView();
view.fit(boundingExtent, null);
//let source = this.vectorSource.getSource();
//source.clear();
//feature.setStyle(this.VectorAltStyles);
//source.addFeatures(feature);
使用ol.geom.Polygon.fromExtent并将结果添加到矢量源似乎不起作用。请有人了解如何实现这一目标吗?
答案 0 :(得分:1)
经过大量试验和错误后终于找到了一条路......
public function get_customers(){
$this->db->select('*,customer.ID as ID,customer.Create_date as Create_date,transport.Name as Transporter, state.Name as State, city.Name as City, area.Name as Area, shipping_state.Name as Shipping_state, shipping_city.Name as Shipping_city, shipping_area.Name as Shipping_area');
$this->db->from('customer');
$this->db->join('transport','transport.ID = customer.Transporter','LEFT');
$this->db->join('state','state.ID = customer.State','LEFT');
$this->db->join('state as shipping_state','state.ID = customer.Shipping_state','LEFT');
$this->db->join('city','city.ID = customer.City','LEFT');
$this->db->join('city as shipping_city','city.ID = customer.Shipping_city','LEFT');
$this->db->join('area','area.ID = customer.Area','LEFT');
$this->db->join('area as shipping_area','area.ID = customer.Shipping_area','LEFT');
return $this->db->get()->result_array();
}