|
POST
|
I was having trouble getting this to work with the wkid 2236, but was able to get it to work using a the geographic coordinate system 4326. Here was the function I used: function selectHistorical() { var queryTask = new QueryTask(window.historicalUrl); var query = new Query(); query.returnGeometry = true; query.outFields = window.historicalOutFields; query.where = "DeviceId = '" + dom.byId("mydropdown").value + "'"; query.outSpatialReference = { "wkid": 4326 }; dojo.connect(queryTask, "onComplete", function (featureSet) { map.graphics.clear(); dojo.forEach(featureSet.features, function (feature) { var point = new Point(feature.geometry.x, feature.geometry.y, new SpatialReference({wkid:4326})); var simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,255,0,0.25]), 1), new Color([255,0,0]) ) var graphic = new Graphic(point, simpleMarkerSymbol); map.graphics.add(graphic); }); }); queryTask.execute(query); } You will need to add the following modules: SpatialReference, Point, SimpleMarkerSymbol, SimpleLineSymbol, and Graphic
... View more
03-10-2014
04:31 AM
|
0
|
0
|
6126
|
|
POST
|
I couldn't see if this resolved the problem since the services don't appear to be public facing, but try chaning the query to the following: query.where = "DeviceId = '" + dom.byId("mydropdown").value + "'";
... View more
03-07-2014
04:19 AM
|
0
|
0
|
3700
|
|
POST
|
Hi Michelle, Could you create a jsfiddle with your code? This will make it easier to troubleshoot.
... View more
03-07-2014
03:45 AM
|
0
|
0
|
3700
|
|
POST
|
Hi Jose, I don't believe it does, but you can check for the supported raster formats here.
... View more
03-05-2014
10:14 AM
|
0
|
0
|
796
|
|
POST
|
Try running the Check Geometry tool on the File Geodatabase feature class. If there are errors, make a copy of the feature class and then run the Repair Geometry tool.
... View more
03-05-2014
10:12 AM
|
0
|
0
|
8143
|
|
POST
|
Not sure why the styling is not working, but one way to work around this is to use an input tag of type button. You can then call this using the "dojo/dom" module. Ex: <!DOCTYPE html> <html> <head> <title>Create a Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/dojo/dijit/themes/soria/soria.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"> <style> html, body, #mapDiv{ padding: 0; margin: 0; height: 100%; } #BasemapToggle { position: absolute; top: 20px; right: 20px; z-index: 50; } #HomeButton { position: absolute; top: 95px; left: 20px; z-index: 50; } #LocateButton { position: absolute; top: 137px; left: 20px; z-index: 50; } #Button1 { position: absolute; top: 180px; left: 20px; z-index: 50; } </style> <script src="http://js.arcgis.com/3.8/"></script> <script> var map; require([ "esri/map", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "dojo/_base/Color", "esri/geometry/Point", "esri/InfoTemplate", "esri/graphic", "dojo/on", "dojo/dom", "esri/dijit/BasemapToggle", "esri/dijit/HomeButton", "esri/dijit/LocateButton", "dojo/dom", "dijit/form/Button", "dojo/domReady!" ], function( Map, SimpleMarkerSymbol, SimpleLineSymbol, Color, Point, InfoTemplate, Graphic, on, dom, BasemapToggle, HomeButton, LocateButton, dom, Button ) { var map; var center = [-80.719892, 28.303518]; var zoom = 13, map = new Map("mapDiv", { center: center, zoom: zoom, basemap: "topo" }); on(map, "load", addGraphic); var storepoint = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0,255,0,0.25]), 1), new Color([255,0,0]) ) function addGraphic(){ var singlePoint1 = new Point([-80.719892, 28.303518]) var singlePoint2 = new Point([-80.694706, 28.352613]) var attr1 = {"Xcoord":singlePoint1.x,"Ycoord":singlePoint1.y}; var attr2 = {"Xcoord":singlePoint2.x,"Ycoord":singlePoint2.y}; var infoTemplate1 = new InfoTemplate("Accident #1", "<br>1234 Gus Hipp Blvd </br><br> </br><a href='https://www.google.com/maps/dir//Gus+Hipp+Blvd,+Rockledge,+FL+32955/@28.3043848,-80.7134764,17z/data=!4m13!1m4!3m3!1s0x88de03d3d113bf6b:0xbeaf353225652c40!2sGus+Hipp+Blvd!3b1!4m7!1m0!1m5!1m1!1s0x88de03d3d113bf6b:0xbeaf353225652c40!2m2!1d-80.714099!2d28.3041225?hl=en'>Get Directions</a> <br/>"); var infoTemplate2 = new InfoTemplate("Accident #2", "<br>1234 Gus Hipp Blvd </br><br> </br><a href='https://www.google.com/maps/dir//Gus+Hipp+Blvd,+Rockledge,+FL+32955/@28.3043848,-80.7134764,17z/data=!4m13!1m4!3m3!1s0x88de03d3d113bf6b:0xbeaf353225652c40!2sGus+Hipp+Blvd!3b1!4m7!1m0!1m5!1m1!1s0x88de03d3d113bf6b:0xbeaf353225652c40!2m2!1d-80.714099!2d28.3041225?hl=en'>Get Directions</a> <br/>"); var store1 = new Graphic(singlePoint1,storepoint,attr1,infoTemplate1); var store2 = new Graphic(singlePoint2,storepoint,attr2,infoTemplate2); map.graphics.add(store1); map.graphics.add(store2); featureArray = []; featureArray.push(store1); map.infoWindow.setFeatures(featureArray); map.infoWindow.show(singlePoint1); // Add a basemap Toggle } var toggle = new BasemapToggle({ map: map, basemap: "satellite" }, "BasemapToggle"); toggle.startup(); // Add home button var home = new HomeButton({ map: map }, "HomeButton"); home.startup(); // Location Button var geoLocate = new LocateButton({ map:map }, "LocateButton"); geoLocate.startup(); on(dom.byId("Button1"), "click", alertIt ); function alertIt(){ alert("1234 Gus Hipp Blvd"); } }); </script> </head> <body class="soria"> <div id="mapDiv"> <div id="BasemapToggle"></div> <div id="HomeButton"></div> <div id="LocateButton"></div> <input id="Button1" type="button" value="1234 Gus Hipp Blvd" /> </div> </body> </html>
... View more
03-05-2014
10:01 AM
|
0
|
0
|
1443
|
|
POST
|
What version of ArcGIS Desktop are you running? I was able to get this to work using 10.2.1.
... View more
03-05-2014
09:26 AM
|
0
|
0
|
2236
|
|
POST
|
Hi Fred, I don't believe you will be able to use a geometry object for the output. You could create a table in_memory. Ex: gcsnad83 = arcpy.SpatialReference(4269) pt = arcpy.Point() pt.X = -13.6544321 pt.Y = -123.132412 ptg = arcpy.PointGeometry(pt,gcsnad83) g = r"IN_MEMORY\table" arcpy.ConvertCoordinateNotation_management(ptg, g, "#", "#", "SHAPE", "MGRS", "#", "#") with arcpy.da.SearchCursor(g, ["MGRS"]) as cursor: for row in cursor: print row[0] del cursor
... View more
03-05-2014
07:51 AM
|
0
|
0
|
2236
|
|
POST
|
Hi Gyeyoung, If you are going to mash-up multiple tiled layers, they should be the same coordinate system. I would recommend creating another tiled service for 'beta_OnlineMap_Topo' in the coordinate system WGS_1984_Web_Mercator_Auxiliary_Sphere.
... View more
03-05-2014
03:11 AM
|
0
|
0
|
1422
|
|
POST
|
Hi Keith, I've never used dojo.xhrPost, but below is an example using XMLHttpRequest: function addFeatures() {
addFeaturesUrl = 'http://server/arcgis/rest/services/ClosedRoadsAddress/FeatureServer/2/addFeatures?features='
addAttributesUrl1 = '[{"attributes":{"Address":"'100 Main St'"}}]'
var obj1 = encodeURIComponent(addAttributesUrl1);
var theUrl1 = addFeaturesUrl + obj1;
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "POST", theUrl1, false );
xmlHttp.send( null );
}
... View more
03-05-2014
02:41 AM
|
0
|
2
|
1739
|
|
POST
|
I believe the problem is due to the coordinate system of the tiled layer. A tiled layer won't be able to reproject on the fly similar to a dynamic or feature layer. I would recommend removing the topo basemap layer, and use your own tiled map service as the basemap. Try the following: function init() {
var initExtent = new esri.geometry.Extent({
"xmin": 1076363,
"ymin": 3109863,
"xmax": 1084228,
"ymax": 3113690,
"spatialReference": {
"wkid": 32139
}
});
esri.config.defaults.map.logoLink = "http://fcor.tamu.edu";
map = new esri.Map("map");
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://fcor-aggiemap.tamu.edu:6080/arcgis/rest/services/aggiemap_beta/beta_OnlineMap_Topo/MapServer");
Vlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://fcor-aggiemap.tamu.edu:6080/arcgis/rest/services/aggiemap_beta/beta_MapInfo/MapServer");
map.addLayers([basemap, Vlayer]);
}
... View more
03-04-2014
04:40 AM
|
0
|
0
|
1422
|
|
POST
|
I thought you were referring to ESRI's basemaps. If the layers are not drawn, for example, due to a scale dependency they will not show in the legend. Try adjusting the zoom level of your application. Ex: map = new Map("map", {
basemap:"streets",
center: [-96.509, 38.367],
zoom: 14
});
... View more
02-26-2014
10:18 AM
|
0
|
0
|
1016
|
|
POST
|
The 'layerInfos' option controls this. See the help here. Specify a subset of the layers in the map to display in the legend. If not set all layers in the map will display in the legend.
... View more
02-26-2014
09:11 AM
|
0
|
0
|
2586
|
|
POST
|
Hi Fern, Any way you could use a File Geodatabase feature class? I try to avoid working with shapefiles unless it's absolutely necessary. You can run a quick test by importing the shapefile into a FGD and see if you receive the same results from the script.
... View more
02-26-2014
08:45 AM
|
0
|
0
|
1759
|
|
POST
|
You are also missing a '{' in the style tag for the #map DIV. Also, if you want the legend to display the layers, you will need to change your extent to where they are visible. Ex: map = new Map("map", {
basemap:"streets",
center: [-96.509, 38.367],
zoom: 14
});
... View more
02-26-2014
06:26 AM
|
1
|
0
|
2586
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|