2014-03-25 76 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