POST
|
Thanks but labeling is not adding to .lyr ! I created a layer from map document it is applying the symbology but not enable and apply Labeling setting in new layer
... View more
10-24-2018
12:51 PM
|
0
|
0
|
582
|
POST
|
I am adding a layer to map docyment through and stand alone ArcPy snippet like this MXD = arcpy.mapping.MapDocument(r"C:\\arcgis\\ArcTutor\\AAA\\MXDs\\map.mxd")
df = arcpy.mapping.ListDataFrames(MXD)[0]
print('Step 3')
layer = arcpy.mapping.Layer("Primary")
layer.minScale = 10000
layer.showLabels = True
arcpy.mapping.AddLayer(df, layer, "AUTO_ARRANGE")
Can you please let me know how I can change the label font two 14 and color to red using ArcPy?
... View more
10-23-2018
02:32 PM
|
0
|
2
|
1060
|
POST
|
Hi Thank and Thanks for reply I changed the code to import arcpy
import os
arcpy.env.workspace = r"C:\\arcgis\\ArcTutor\\AAA\\MXDs"
MXD = arcpy.mapping.MapDocument(r"C:\\arcgis\\ArcTutor\\AAA\\MXDs\\map.mxd")
DF = arcpy.mapping.ListDataFrames(MXD)[0]
lyr = "C:\\arcgis\\ArcTutor\\AAA\\GDBs\\Delaware.gdb\\Kent\\Kent"
arcpy.MakeFeatureLayer_management(lyr, 'shplyr')
arcpy.mapping.AddLayer(DF, lyr, "AUTO_ARRANGE")
print(" Step 4")
MXD.saveACopy('newmxd.mxd')
del MXD
print(" Done") and now I am getting AssertionError: on assert isinstance(add_layer, Layer) File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\mapping.py", line 49, in AddLayer
assert isinstance(add_layer, Layer)
AssertionError
... View more
10-19-2018
01:44 PM
|
0
|
2
|
587
|
POST
|
I am trying to add a Feature Class from a Geodatabase Dataset to an MXD and save a copy like this but I am getting following errors on each methos import arcpy
import os
arcpy.env.workspace = r"C:\arcgis\ArcTutor\AAA\MXDs"
MXD = arcpy.mapping.MapDocument(r"C:\arcgis\ArcTutor\AAA\MXDs\map.mxd")
DF = arcpy.mapping.ListDataFrames(MXD)[0]
lyr = arcpy.mapping.Layer("C:\arcgis\ArcTutor\AAA\GDBs\Delaware.gdb\Kent\Kent")
arcpy.mapping.AddLayer(DF, layer, "AUTO_ARRANGE")
MXD.saveACopy('newmxd.mxd')
del MXD
print(" Done") and import arcpy
import os
arcpy.env.workspace = r"C:\arcgis\ArcTutor\AAA\MXDs"
MXD = arcpy.mapping.MapDocument(r"C:\arcgis\ArcTutor\AAA\MXDs\map.mxd")
DF = arcpy.mapping.ListDataFrames(MXD)[0]
lyr = "C:\arcgis\ArcTutor\AAA\GDBs\Delaware.gdb\Kent\Kent"
arcpy.MakeFeatureLayer_management(lyr, 'shplyr')
arcpy.mapping.AddLayer(DF, lyr, "AUTO_ARRANGE")
print(" Step 4")
MXD.saveACopy('newmxd.mxd')
del MXD
print(" Done") arcpy
... View more
10-19-2018
10:50 AM
|
0
|
4
|
679
|
POST
|
Can you please take a look at this demo snippet and let me know how I can add animation to cluster breaks on zoom in out? As you can see in the demo cluster symbols disappear on zoom in, out and re rendered after zoom stops but how we can add animation to clusters <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Cluster</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.25/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.25/esri/css/esri.css">
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
#map{ margin: 0; padding: 0; }
/* center the image in the popup */
.esriViewPopup .gallery { margin: 0 auto !important; }
</style>
<script>
// helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
// http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
var dojoConfig = {
paths: {
extras: location.pathname.replace(/\/[^/]+$/, "") + "/extras"
}
};
</script>
<script src="https://js.arcgis.com/3.25/"></script>
<script>
var map;
require([
"dojo/parser",
"dojo/ready",
"dojo/_base/array",
"esri/Color",
"dojo/dom-style",
"dojo/query",
"esri/map",
"esri/request",
"esri/graphic",
"esri/geometry/Extent",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/PictureMarkerSymbol",
"esri/renderers/ClassBreaksRenderer",
"esri/layers/GraphicsLayer",
"esri/SpatialReference",
"esri/dijit/PopupTemplate",
"esri/geometry/Point",
"esri/geometry/webMercatorUtils",
"extras/ClusterLayer",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",
"dojo/domReady!"
], function(
parser, ready, arrayUtils, Color, domStyle, query,
Map, esriRequest, Graphic, Extent,
SimpleMarkerSymbol, SimpleFillSymbol, PictureMarkerSymbol, ClassBreaksRenderer,
GraphicsLayer, SpatialReference, PopupTemplate, Point, webMercatorUtils,
ClusterLayer
) {
ready(function() {
parser.parse();
var clusterLayer;
var popupOptions = {
"markerSymbol": new SimpleMarkerSymbol("circle", 20, null, new Color([0, 0, 0, 0.25])),
"marginLeft": "20",
"marginTop": "20"
};
map = new Map("map", {
basemap: "oceans",
center: [-117.789, 33.543],
zoom: 13
});
map.on("load", function() {
// hide the popup's ZoomTo link as it doesn't make sense for cluster features
domStyle.set(query("a.action.zoomTo")[0], "display", "none");
// get the latest 1000 photos from instagram/laguna beach
var photos = esriRequest({
url: "data/1000-photos.json",
handleAs: "json"
});
photos.then(addClusters, error);
});
function addClusters(resp) {
var photoInfo = {};
var wgs = new SpatialReference({
"wkid": 4326
});
photoInfo.data = arrayUtils.map(resp, function(p) {
var latlng = new Point(parseFloat(p.lng), parseFloat(p.lat), wgs);
var webMercator = webMercatorUtils.geographicToWebMercator(latlng);
var attributes = {
"Caption": p.caption,
"Name": p.full_name,
"Image": p.image,
"Link": p.link
};
return {
"x": webMercator.x,
"y": webMercator.y,
"attributes": attributes
};
});
// popupTemplate to work with attributes specific to this dataset
var popupTemplate = new PopupTemplate({
"title": "",
"fieldInfos": [{
"fieldName": "Caption",
visible: true
}, {
"fieldName": "Name",
"label": "By",
visible: true
}, {
"fieldName": "Link",
"label": "On Instagram",
visible: true
}]
});
// cluster layer that uses OpenLayers style clustering
clusterLayer = new ClusterLayer({
"data": photoInfo.data,
"distance": 100,
"id": "clusters",
"labelColor": "#fff",
"labelOffset": 10,
"resolution": map.extent.getWidth() / map.width,
"singleColor": "#888",
"singleTemplate": popupTemplate
});
var defaultSym = new SimpleMarkerSymbol().setSize(4);
var renderer = new ClassBreaksRenderer(defaultSym, "clusterCount");
var picBaseUrl = "https://static.arcgis.com/images/Symbols/Shapes/";
var blue = new PictureMarkerSymbol(picBaseUrl + "BluePin1LargeB.png", 32, 32).setOffset(0, 15);
var green = new PictureMarkerSymbol(picBaseUrl + "GreenPin1LargeB.png", 64, 64).setOffset(0, 15);
var red = new PictureMarkerSymbol(picBaseUrl + "RedPin1LargeB.png", 72, 72).setOffset(0, 15);
renderer.addBreak(0, 2, blue);
renderer.addBreak(2, 200, green);
renderer.addBreak(200, 1001, red);
clusterLayer.setRenderer(renderer);
map.addLayer(clusterLayer);
// close the info window when the map is clicked
map.on("click", cleanUp);
// close the info window when esc is pressed
map.on("key-down", function(e) {
if (e.keyCode === 27) {
cleanUp();
}
});
}
function cleanUp() {
map.infoWindow.hide();
clusterLayer.clearSingles();
}
function error(err) {
console.log("something failed: ", err);
}
// show cluster extents...
// never called directly but useful from the console
window.showExtents = function() {
var extents = map.getLayer("clusterExtents");
if ( extents ) {
map.removeLayer(extents);
}
extents = new GraphicsLayer({ id: "clusterExtents" });
var sym = new SimpleFillSymbol().setColor(new Color([205, 193, 197, 0.5]));
arrayUtils.forEach(clusterLayer._clusters, function(c, idx) {
var e = c.attributes.extent;
extents.add(new Graphic(new Extent(e[0], e[1], e[2], e[3], map.spatialReference), sym));
}, this);
map.addLayer(extents, 0);
};
});
});
</script>
</head>
<body>
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'headline',gutters:false"
style="width: 100%; height: 100%; margin: 0;">
<div id="map"
data-dojo-type="dijit/layout/ContentPane"
data-dojo-props="region:'center'">
</div>
</div>
</body>
</html>
... View more
08-29-2018
11:05 AM
|
0
|
0
|
957
|
POST
|
Can you please take a look at this demo and let me know why I am not able to add the simple render / Simple Marker to the map for feature layers require([
"esri/map",
"esri/layers/FeatureLayer",
"esri/renderers/SimpleRenderer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color",
"dojo/domReady!"
],
function(
Map,
FeatureLayer,
SimpleRenderer,
SimpleMarkerSymbol,
SimpleLineSymbol,
Color,
) {
var map = new Map("map", {
basemap: "streets",
center: [-82.44109, 35.6122],
zoom: 17
});
var featureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0");
featureLayer.setRenderer( new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10,
new Color([0,255,0,0.25])));
map.addLayer(featureLayer);
});
... View more
08-27-2018
03:15 PM
|
0
|
1
|
641
|
POST
|
Thanks for reply FC Basson but what if I want to have my own toolbar? or enabling some more functions like getting x and y of added point or enabling edits and replacing points on the map! the current API is so silence about this things and I was thinking to create a new function to cover all of this!
... View more
01-16-2017
10:22 PM
|
0
|
1
|
652
|
POST
|
ArcGIS API for JavaScript is using ESRI Toolbar Widget to handle Drawing Geometry(graphics) on the maps. Here is the Demo doing this job. Now my question is, is there a way to not use the "esri/toolbars/draw" facilities (Widget) and draw on the Graphic Layer by using core API coding?
... View more
01-16-2017
10:06 PM
|
0
|
3
|
1549
|
POST
|
Thanks Robert, I Update the code to $("#show-all-schools").on("click", function () {
map.setExtent(schoolGraphicLayer.fullExtent, true);
}); But I am getting this error now!
... View more
01-15-2017
12:53 AM
|
0
|
0
|
1926
|
POST
|
I am trying to publish a feature service from ArcMap 10.4.1 and I need to Register the Map with SQL Server (sde)which is installed in a machine outside of our network. I have all authentications , instance and database name but I am getting this error: "Failed to connect the specified server. Do you want to continue? Failure to access the DBMS server" Can you please let me know is it possible to connect to a SQL server database which is installed out the network? and why I am getting this error? Thanks
... View more
12-23-2016
01:18 PM
|
0
|
2
|
1501
|
POST
|
Ok Robert, I just have one more question. Can you please take a look at this Post and comment out you idea? How To Create Heat Map Based on GraphicsLayer Instead of FeatureLayer In ArcGIS JS API - Geographic Information Systems …
... View more
12-09-2016
02:25 PM
|
0
|
1
|
1246
|
POST
|
Can you please let me know where can I find an example of Point with HTML5 canvas graphic?
... View more
12-09-2016
01:44 PM
|
0
|
4
|
1246
|
POST
|
Thanks Robert, but is there any other solution for this? I mean in case of not using SimpleMarkerStmbol? can we assign the CSS directly to the point?
... View more
12-09-2016
01:14 PM
|
0
|
6
|
1246
|
POST
|
Can you please let me know if there is a way to bind a CSS class `.marker` to an ArcGIS `SimpleMarkerSymbol` in a graphic layer? I have a `SimpleMarkerSymbol` called `schoolMarker` which I am styling it using ESRI's options but I need to add more CSS styles like `.marker` var schoolMarker = new SimpleMarkerSymbol();
schoolMarker.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);
schoolMarker.setSize(30);
schoolMarker.setOutline(null);
schoolMarker.setColor(new Color([255,116,0,0.25])); Here is the CSS class: .marker{
stroke-linecap: round;
stroke-linejoin: round;
stroke-opacity: 1.0;
fill-opacity: 1.0;
background-color: rgb(0, 89, 190);
stroke: rgb(0, 89, 190);
fill: rgb(0, 89, 190);
fill-opacity: 1;
stroke-width: 70pt;
stroke-opacity: 1;
opacity: 0.12;
}
... View more
12-09-2016
12:16 PM
|
0
|
8
|
2419
|
POST
|
well I did what you said but still getting same error!
... View more
11-09-2016
09:16 AM
|
0
|
0
|
781
|
Title | Kudos | Posted |
---|---|---|
1 | 03-07-2011 02:23 PM | |
1 | 09-02-2015 12:50 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|