2014-03-25 66 views

回答

0

我最终做了以下哪些工作适合我。

使用没有控制创建地图:

defaultMapOptions.setControls(new JObjectArray(new JSObject[0])); 

然后添加自定义控件到地图中。 (在这里,我只是一个增加)

map.addControl(new PanZoomBar()); 

PanZoomBar可以在平移以及缩放帮助。这解决了导航问题。至于框选,

SelectFeatureOptions selectBoxFeatureOptions = new SelectFeatureOptions(); 
selectBoxFeatureOptions.setBox(true); 
SelectFeature boxSelectFeature = new SelectFeature(vectorLayer,selectBoxFeatureOptions); 
boxSelectFeature.setClickOut(false); 
boxSelectFeature.setToggle(false); 
boxSelectFeature.setMultiple(false); 
boxSelectFeature.setToggleKey("ctrlKey"); 
boxSelectFeature.setMultipleKey("shiftKey"); 
map.addControl(boxSelectFeature); 

Additional Reference