要註意,書寫時遵循先行性,程式之後用的所有,之前必須設置或定義好,否則沒有效果出現 var serviceUrl = "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYCDemographics1/Feature ...
要註意,書寫時遵循先行性,程式之後用的所有,之前必須設置或定義好,否則沒有效果出現
var serviceUrl = "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/NYCDemographics1/FeatureServer/0";
var popupTemplate = {
title:"Marriage in NY, Zip Code:{ZIP}",
content:{
type:"fields",
fieldInfos:[{
fieldName:"",
label:"",
format:{
place:0,
digitSeparator:true
}
},{},...]
}
}
var layer = new FeatureLayer({
url:serviceUrl,
outFields:["*"],
popupTemplate:popupTemplate
})
var map = new Map({
basemap:"dark-gray"
});
map.add(layer);
var view = new MapView({
container:"viewDiv",
map:map,
center:[-73.950, 40.702],
zoom:13
})