ZoomIN to Feature with ol3

المشرف العام

Administrator
طاقم الإدارة
I have a requirement, upon user action I need to zoomin to the polygon/feature on layer. To acheive this

  1. Getting the feature object based on unique Id by using wfs?request=GetFeature
  2. Getting required feature as expected

    {"type":"Feature","id":"SEARCH.fid--2a37c556_1505cda2d3b_1593","geometry":{"type":"Polygon","coordinates":[[[3400.95051588509,4083.02548123558],[3502.22770354563,3981.74829357504],[3598.40160615068,4077.87129986026],[3498.61223022689,4180.68719557739],[3400.95051588509,4083.02548123558]]]},"geometry_name":"GEOM","properties":{"LAYER":"CAGE_INFO","TAG":"7234","NUMBER":"000108"}}
    1. Now, I used the below to options and unsuccessful with the bothmap.getView().fit(feature.geometry.coordinates,map.getSize());map.getView().fit(feature.geometry,map.getSize());
Please suggest



أكثر...
 
أعلى