five application :Labeling features
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<link rel="stylesheet" href="//js.arcgis.com/3.13/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
}
</style> <script src="//js.arcgis.com/3.13/"></script>
<script>
var map; require([
"esri/map",
"esri/geometry/Extent",
"esri/layers/FeatureLayer", "esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/TextSymbol",
"esri/renderers/SimpleRenderer", "esri/layers/LabelLayer", "esri/Color",
"dojo/domReady!"
], function(
Map, Extent, FeatureLayer,
SimpleLineSymbol, SimpleFillSymbol, TextSymbol, SimpleRenderer,
LabelLayer,
Color
) {
// load the map centered on the United States
var bbox = new Extent({"xmin": -1940058, "ymin": -814715, "xmax": 1683105, "ymax": 1446096, "spatialReference": {"wkid": 102003}});
map = new Map("map", {
extent: bbox
}); var labelField = "STATE_NAME"; // create a renderer for the states layer to override default symbology
var statesColor = new Color("#f00");
var statesLine = new SimpleLineSymbol("solid", statesColor, 1);
var statesSymbol = new SimpleFillSymbol("solid", statesLine, null);
var statesRenderer = new SimpleRenderer(statesSymbol);
// create a feature layer to show country boundaries
var statesUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3";
var states = new FeatureLayer(statesUrl, {
id: "states",
outFields: [labelField]
});
states.setRenderer(statesRenderer);
map.addLayer(states); // create a text symbol to define the style of labels
var statesLabel = new TextSymbol().setColor(new Color("#00f"));
statesLabel.font.setSize("12pt");
statesLabel.font.setFamily("arial");
var statesLabelRenderer = new SimpleRenderer(statesLabel);
var labels = new LabelLayer({ id: "lab" });
// tell the label layer to label the countries feature layer
// using the field named "admin"
labels.addFeatureLayer(states, statesLabelRenderer, "{" + labelField + "}");
// add the label layer to the map
map.addLayer(labels);
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>
five application :Labeling features的更多相关文章
- OpenCms Application dev-ref
OpenCms Application Overview Before undertaking development, it will be helpful to understand the ba ...
- IIS 7.0 Features and Vista Editions
原文 IIS 7.0 Features and Vista Editions Overview of IIS 7.0 differences Across Windows Vista Editions ...
- 4: 模块化应用程序开发 Modular Application Development Using Prism Library 5.0 for WPF (英汉对照版)
A modular application is an application that is divided into a set of loosely coupled functional uni ...
- 学习ASP.NET Core, 怎能不了解请求处理管道[3]: 自定义一个服务器感受一下管道是如何监听、接收和响应请求的
我们在<服务器在管道中的"龙头"地位>中对ASP.NET Core默认提供的具有跨平台能力的KestrelServer进行了介绍,为了让读者朋友们对管道中的服务器具有更 ...
- 如果你想深刻理解ASP.NET Core请求处理管道,可以试着写一个自定义的Server
我们在上面对ASP.NET Core默认提供的具有跨平台能力的KestrelServer进行了详细介绍(<聊聊ASP.NET Core默认提供的这个跨平台的服务器——KestrelServer& ...
- ASP.NET Core 中文文档 第三章 原理(16).NET开放Web接口(OWIN)
原文:Open Web Interface for .NET (OWIN) 作者:Steve Smith. Rick Anderson 翻译:谢炀(kiler398) 校对:孟帅洋(书缘) ASP.N ...
- Feature Flag
know more from here: https://www.youtube.com/watch?v=WMRjj06R6jg&list=UUkQX1tChV7Z7l1LFF4L9j_g F ...
- apk反编译(6)ProGuard 工具 android studio版官方教程[作用,配置,解混淆,优化示例]
ProGuard In this document Enabling ProGuard (Gradle Builds) Configuring ProGuard Examples Decoding O ...
- session问题
如果 <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424&q ...
随机推荐
- TCP/IP笔记(一)网络基础知识
计算机与网络发展 计算机自诞生伊始,经历了一系列演变与发展.大型通用机计算机.超级计算机.小型机.个人电脑.工作站.便携式电以及现如今的智能手机终端都是这一过程的产物.它们性能逐年增强,价格却逐年下降 ...
- 带宽的单位为什么是Hz而不是bps?
如果从电子电路角度出发,带宽(Bandwidth)本意指的是电子电路中存在一个固有通频带,这个概念或许比较抽象,我们有必要作进一步解释.大家都知道,各类复杂的电子电路无一例外都存在电感.电容或相当功能 ...
- Servlet 国际化
在我们开始之前,先来看看三个重要术语: 国际化(i18n):这意味着一个网站提供了不同版本的翻译成访问者的语言或国籍的内容. 本地化(l10n):这意味着向网站添加资源,以使其适应特定的地理或文化区域 ...
- Spring MVC 分离了控制器、模型对象、过滤器以及处理程序对象的角色
通过策略接口,Spring 框架是高度可配置的,而且包含多种视图技术,例如 JavaServer Pages(JSP)技术.Velocity.Tiles.iText和POI.Spring MVC 框架 ...
- 我买网B轮融资成功,五周年豪掷千万回馈会员
对中粮我买网而言,近期的B轮融资应该算是最大的好消息了------8月1日,中粮我买网在京宣布完毕B轮融资.金额高达1亿美元.被称为"食品电商史上最大融资".据悉,本次融资 ...
- printf,sprintf,vsprintf
printf,sprintf比较常用,vsprintf不常用. 1. 三个函数的声明: int printf (const char * szFormat, ...); int sprintf (ch ...
- linux系统启动过程具体解释-开机加电后发生了什么 --linux内核剖析(零)
本文參考了例如以下文章 深入理解linux启动过程 mbr (主引导记录(Master Boot Record)) 电脑从开机加电到操作系统main函数之前执行的过程 详细解释linux系统的启动过程 ...
- 一步步学习python
python是一种功能比较强的脚本,尤其是在网络应用上,又称作:胶水语言.具体的简介可以在维基百科.百度百科等查得到他的发展史,有事一贯犹 如unix linux等老外打发无聊时间发明的强大工具,这是 ...
- poj 1515+poj 1438(边双连通)
题目链接:http://poj.org/problem?id=1515 思路:题目的意思是说将一个无向图改成有向图,使其成为强连通,输出所有的边.我们可以求无向图的边双连通分量,对于同一个双连通分量, ...
- Laravel5.1 -控制器(初步了解)
首先道个歉 这篇笔记是前两天就应该写的,可大K有点事儿要忙 就耽误了,今天抽空学了学控制器,并写个笔记分享下. 为什么要使用控制器 像我们之前写一些逻辑呢都是在Route(路由)中,搞得Route文件 ...