var jsonFS = {
"geometryType": "esriGeometryPolygon",
"features": [
{
"attributes": {
"Name": "Polygon2", // "Point2",
"OBJECTID": 2

},
"geometry": {
"rings": [
[[117.008726, 30.931672], [117.009635, 30.930947], [117.008825, 30.930337], [117.007929, 30.931062]]
]
}
}
],
"spatialReference": {
"wkid": 4326
}
};
var fs = new FeatureSet(jsonFS);
var layerDefinition = {
"displayFieldName": "Name",
"geometryType": "esriGeometryPolygon",
"spatialReference": {
"wkid": 4326
},
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID"
},
{
"name": "Name",
"type": "esriFieldTypeString",
"alias": "Name",
"length": 10
}
]
}

var featureCollection = {
layerDefinition: layerDefinition,
featureSet: fs
};

featureLayer = new FeatureLayer(featureCollection);

symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
     new Color([112, 112, 112]), 1), new Color([236, 136, 136, 0.75]));
var renderer = new SimpleRenderer(symbol);
featureLayer.setRenderer(renderer);

map.addLayers([featureLayer]);

add_featurelayer_to_map的更多相关文章

随机推荐

  1. XBOX360

    [汇总+分享]XBOX360多人游戏汇总贴https://tieba.baidu.com/p/3550398060?pn=13&red_tag=3423139816&traceid= ...

  2. FastDFS配置 ***

    FastDFS配置 docker pull delron/fastdfs docker run -dti --network=host --restart=always --name tracker ...

  3. 黄聪:C#如何Json转字符串;字符串转Json;Newtonsoft.Json(Json.Net)学习笔记(转)

    Newtonsoft.Json,一款.NET中开源的Json序列化和反序列化类库(下载地址http://json.codeplex.com/). 下面是Json序列化和反序列化的简单封装: /// & ...

  4. 【springBoot】之概述

    springboot是什么? springboot不是对spring的增强,而是一个快速使用spring进行开发的框架. 其产生的背景是因为随着动态语言(Scala,Groovy)的流行,Java语言 ...

  5. win10以上系统设定PPTP自动拨号

    :bohaorasdial adsl 123 123if not %errorlevel% == 0 goto :bohaoexit rasdial adsl 123 123 rasdial是开始拨号 ...

  6. [UE4]不推荐的UI更新方式

    在创建UI的时候,把UI保存到一个变量,直接访问其中的控件. 这种方法会增加耦合,不推荐,应当尽量避免使用这种方式.

  7. vue 动态路由 Get传值

    main.js //2.配置路由 注意:名字 const routes = [ { path: '/home', component: Home }, { path: '/news', compone ...

  8. MySQL5.7修改默认密码、随机密码

    mysql5.7以后默认生成随机密码,修改root用户密码 1.修改配置参数Linux: /etc/my.cnf Windows:  C:\ProgramData\MySQL\MySQL Server ...

  9. java入门简介

    1.java运行环境 下载的jdk中包含了java运行时的环境(JRE),JRE又包含了java虚拟机(JVM) 2.java运行过程 源文件(.java)由编译器编译为字节码(.class)文件,再 ...

  10. ThreadException

    在windows窗体程序中,使用 ThreadException 事件来处理 UI 线程异常,使用 UnhandledException 事件来处理非 UI 线程异常.ThreadException可 ...