I am facing issue of Feature Layer being too slow and hangs browser , we changed the projection system to WebMercator performance increased in FF but in IE it sill hangs.when i zoom in FF it hangs what is the issue we have about 220 polygons which is not too much .Below is services and html code
Rest Service
Layer: World_Countires_v3_WMS (ID: 0)
Name: World_Countires_v3_WMS
Display Field: COUNTRY
Type: Feature Layer
Geometry Type: esriGeometryPolygon
Description: World Countires Map (v3) with only few fields. No changes to the data from V1.
Definition Expression:
Copyright Text:
Default Visibility: true
MaxRecordCount: 1000
Supported Query Formats: JSON, AMF
Min Scale: 0
Max Scale: 0
Supports Advanced Queries: true
Supports Statistics: true
Has Labels: false
Can Modify Layer: true
Can Scale Symbols: false
Extent:
XMin: -2.00375070672E7
YMin: -3.02409719584E7
XMax: 2.0037507067199998E7
YMax: 1.8460513218900003E7
Spatial Reference: 102100 (3857)
Drawing Info:
Renderer:
Simple Renderer:
Symbol:
Style: esriSFSSolid
Color: [201, 242, 208, 255]
Outline:
Style: esriSLSSolid
Color: [110, 110, 110, 255]
Width: 0
Label:
Description:
Transparency: 0
Labeling Info:
HasZ: false
HasM: false
Has Attachments: false
HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText
Type ID Field: null
Fields:
OBJECTID_1 ( type: esriFieldTypeOID , alias: OBJECTID_1 )
Shape ( type: esriFieldTypeGeometry , alias: Shape )
OBJECTID ( type: esriFieldTypeInteger , alias: OBJECTID )
COUNTRY ( type: esriFieldTypeString , alias: COUNTRY , length: 50 )
HTML code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Feature Layer Only Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="http://js.arcgis.com/3.6/"></script>
<script>
require([
"dojo/dom-construct",
"esri/map",
"esri/layers/FeatureLayer",
"esri/geometry/Extent",
"esri/InfoTemplate",
"dojo/domReady!"
], function(
domConstruct,
Map,
FeatureLayer,
Extent,
InfoTemplate
) {
var bounds = new Extent({
"xmin":-2.204125777392E7,
"ymin":-1.4348737528212927E7,
"xmax":2.204125777392E7,
"ymax":2.3907585678113185E7,
"spatialReference":{"wkid":102100}
});
var map = new Map("map", {
extent: bounds
});
var url = "http://10.32.9.106:6080/arcgis/rest/services/KX_Mapping/World_Countries_v3_WMS_v1/MapServer/0";
var template = new InfoTemplate("World Regions", "Region: ${COUNTRY}");
var fl = new FeatureLayer(url, {
id: "world-regions",
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
autoGeneralize :true,
maxAllowableOffset:0,
outFields: ["*"]
//infoTemplate: template
});
require(["dojo/on", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "dojo/_base/Color", "esri/graphic"], function(on, SimpleFillSymbol, SimpleLineSymbol, Color, Graphic) {
on(fl, "click", function(evt) {
// clears current selection
map.graphics.clear();
// create new graphic with selected graphic's geometry
var graphic = new Graphic(evt.graphic.geometry);
// create a new symbol for the graphic
var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_FORWARD_DIAGONAL, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.5]));
// add symbol to the graphic
graphic.setSymbol(sfs);
// add the graphic to the map
map.graphics.add(graphic);
});
});
//fl.setEditable(false)
//fl.minScale=0;
//fl.maxScale=3;
//fl.setAutoGeneralize(false);
map.addLayer(fl);
}
);
</script>
</head>
<body>
<div id="map"></div>
</body>
</html>