레이어의 맞춤 속성을 읽으려면 어떻게해야하나요?GUIDE4YOU/OL3 - 레이어의 맞춤 속성을 읽는 방법
예를 들어 사용자 지정 테스트 및 값 sam의 레이어를 추가했습니다.
createG4U('#g4u-map', 'conf/client.commented.json', 'conf/layers.commented.json').then(function (map) { map.asSoonAs('ready', true, function() { map.get('api').addFeatureLayer({ "id": "1", "type": "GeoJSON", "style": stylefunction, "source": { "url": "files/sample.json" }, "visible": true, "test" : "sam" }); map.getLayers().forEach(function (layer) { console.log(layer); }); }); });
종류의 관련
샘
가 작동하지, 나는 항상 '정의되지 않은'얻을. 속성 ID (필수 속성)를 읽는 것조차도 '정의되지 않음'입니다. – Sam
답변을 업데이트했습니다. –