2017-02-06 8 views

답변

1

그냥 오른쪽 상단 모서리에

<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.19/esri/css/esri.css"> 
 
<style> 
 
    html, body, #mapDiv { 
 
    height: 100%; 
 
    padding: 0; 
 
    margin: 0; 
 
    } 
 
    #inputAttribute { 
 
    position: absolute; 
 
    top: 10px; 
 
    right: 10px; 
 
    width: 300px; 
 
    } 
 
</style> 
 

 
<script>var dojoConfig = { parseOnLoad:true };</script> 
 
<script src="https://js.arcgis.com/3.19compact/"></script> 
 
<script> 
 
    require(["esri/map", "esri/layers/FeatureLayer", "dojo/on", "dojo/dom", "dojo/domReady!"], function(Map, FeatureLayer, On, Dom) { 
 
    var node = Dom.byId('inputAttribute'); 
 
    var map = new Map("mapDiv", { 
 
     center: [-122.41, 37.78], 
 
     zoom: 17, 
 
     basemap: "topo" 
 
    }); 
 
    var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Street_Trees/FeatureServer/0",{ 
 
     outFields: ["qSpecies"] 
 
    }); 
 
    map.addLayer(featureLayer); 
 
    On(featureLayer, 'click', function (e) { 
 
     node.value = e.graphic.attributes.qSpecies; 
 
    }); 
 
    }); 
 
</script> 
 
<div id="mapDiv"></div> 
 
<input type="text" name="attribut" id="inputAttribute">

+0

덕분에 많은 regeads을 InputText]를을 채울 것입니다, 나무에 클릭 –

+0

투표를 추가 하시겠습니까? 내 대답이 유효합니까? 나중에 sahbi :) – LMokrane