我想一個是MultiPolygon負載從SQL地理傑森對象和它不工作3負載幾何形狀..的OpenLayers從SQL
是什麼工作(這將創建幾何對象)...
var geoJsonObj = {
'type': 'Feature',
'geometry': {
"coordinates": [
[[[-91.0759333619999, 40.15440933399983],
[-91.066378752, 40.154309680999823],
[-91.066282352, 40.157927062999832],
[-91.0751007809999, 40.157994385999814],
[-91.0758658189999, 40.157997289999805],
[-91.075866624, 40.157608482999827],
[-91.0758737049999, 40.157300970999813],
[-91.0759333619999, 40.15440933399983]]]
]
, "type": "MultiPolygon"
}
};
什麼行不通......
var geoJsonObj = {
'type': 'Feature',
'geometry': webMapValues.geometry
};
其中webMapValues.geometry從SQL填充和具有的價值...
"{
"coordinates":
[[[
[-91.0759333619999,40.15440933399983],
[-91.066378752,40.154309680999823],
[-91.066282352,40.157927062999832],
[-91.0751007809999,40.157994385999814],
[-91.0758658189999,40.157997289999805],
[-91.075866624,40.157608482999827],
[-91.0758737049999,40.157300970999813],
[-91.0759333619999,40.15440933399983]
]]]
,"type":"MultiPolygon"}"
注意唯一的區別是SQL加載的變量中的值在「」引號內。
我試過了一些「格式」的解決方案,但似乎跑到了死衚衕。
任何幫助,非常感謝!
黨...只是看到你到了那裏,而我是用代碼片段播放。 –