|
POST
|
Yes. But I've decided to take the results and turn them into a featurelayer instead. So I'm able to zoom using var graphicsExtent = graphicsUtils.graphicsExtent(features); map.setExtent(graphicsExtent);
... View more
08-19-2015
08:50 AM
|
0
|
0
|
1020
|
|
POST
|
Ah, I was forgetting that, but it still didn't work. But I know why, it isn't a feature layer that is being returned, rather a ArcGISDynamicMayServiceLayer. Any idea how to zoom to that?
... View more
08-18-2015
11:59 AM
|
0
|
0
|
1020
|
|
POST
|
Hmm.... this is failing with a weird "typeerror: d is not a function". My guess is this is because I don't have a required statement. This is just part of a big project, so here are the ones I have. Am I missing one? require(["dojo/dom", "dojo/_base/array", "dojo/date/locale", "dijit/registry", "esri/domUtils", "esri/map", "esri/dijit/Scalebar", "esri/dijit/OverviewMap", "esri/graphic", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/GraphicsLayer", "esri/layers/FeatureLayer", "esri/tasks/Geoprocessor", "esri/tasks/FeatureSet", "esri/dijit/Legend", "dojo/parser", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "esri/SpatialReference", "esri/dijit/PopupTemplate", "esri/renderers/smartMapping", "dojo/dom-construct", "dojo/data/ItemFileReadStore", "dijit/form/FilteringSelect", "esri/graphicsUtils", "esri/Color", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/AccordionContainer", "esri/geometry/webMercatorUtils", "esri/geometry/Geometry", "dijit/form/Select", "dijit/Dialog", "dijit/form/Button", "dijit/form/DateTextBox", "dojo/domReady!"], function (dom, arrayUtils, locale, registry, domUtils, Map, Scalebar, OverviewMap, Graphic, ArcGISDynamicMapServiceLayer, GraphicsLayer, FeatureLayer, Geoprocessor, FeatureSet, Legend, parser, SimpleFillSymbol, SimpleLineSymbol, SpatialReference, PopupTemplate, smartMapping, domConstruct, ItemFileReadStore, FilteringSelect, graphicsUtils, Color, BorderContainer, ContentPane, AccordionContainer, webMercatorUtils, Geometry) {
... View more
08-18-2015
09:18 AM
|
0
|
5
|
1020
|
|
POST
|
Hi, This should be pretty easy, but I've tried a bunch of stuff and cant get it to work. How do I zoom to the newly outputted feature layer created by a geoprocessing service I create. Here is the code for I use to create it. I've tried the commented out method for setting the map's extent with the test1 and test2 variables, but it doesn't work. Thanks, -dave function gpJobComplete(jobinfo) { //get the result map service layer and add to map gp.getResultImageLayer(jobinfo.jobId, null, null, function (layer) { layer.setOpacity(0.7); layer.id = "Created Mammal Data"; map.addLayers([layer]); }); // var zoomLayer = map.getLayer('Created Mammal Data'); // var test1 = webMercatorUtils.geographicToWebMercator(zoomLayer.fullExtent); // var test2 = zoomLayer.fullExtent; // map.setExtent(test1, true); map.on("layers-add-result", function (evtObj) { domUtils.show(dom.byId('legendWrapper')); if (!legend) { var layerInfo = array.map(evtObj.layers, function (layer, index) { return { layer: layer.layer, title: layer.layer.name }; }); legend = new Legend({ map: map, layerInfos: layerInfo }, "legendWrapper"); legend.startup(); } }); }
... View more
08-18-2015
07:16 AM
|
0
|
7
|
3214
|
|
POST
|
Thanks! Creating a new website (of type ASP.NET Empty Web Site in Visual C#), then adding new item-->html page did it! I was creating a project with the template for javascript-->store apps-->Blank App. It probably adds a bunch of extra stuff I don't need that causes the error.
... View more
07-21-2015
11:33 AM
|
0
|
0
|
1432
|
|
POST
|
Here is the code I'm using for the default.html (which works when I open it in chrome, just fails when I hit F5 to debug in VS using Local Machine) <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <title></title> <link rel="stylesheet" href="http://js.arcgis.com/3.14/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.14/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0; padding: 0; } #map { padding: 0; } </style> <script src="http://js.arcgis.com/3.14/"></script> <script> var map; require([ "esri/map", "esri/dijit/BasemapGallery", "esri/arcgis/utils", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/TitlePane", "dojo/domReady!" ], function ( Map, BasemapGallery, arcgisUtils, parser ) { parser.parse(); map = new Map("map", { basemap: "topo", center: [-105.255, 40.022], zoom: 13 }); //add the basemap gallery, in this case we'll display maps from ArcGIS.com including bing maps var basemapGallery = new BasemapGallery({ showArcGISBasemaps: true, map: map }, "basemapGallery"); basemapGallery.startup(); basemapGallery.on("error", function (msg) { console.log("basemap gallery error: ", msg); }); }); </script> </head> <body class="claro"> <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'" style="padding:0;"> <div style="position:absolute; right:20px; top:10px; z-Index:999;"> <div data-dojo-type="dijit/TitlePane" data-dojo-props="title:'Switch Basemap', closable:false, open:false"> <div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;"> <div id="basemapGallery"></div> </div> </div> </div> </div> </div> </body> </html>
... View more
07-20-2015
07:14 AM
|
0
|
2
|
1432
|
|
POST
|
Thanks, What template do you use when you start a new project in VS? For plug-ins, I installed typescript, the arcgis-js-api-typescript and dojo using nuget. In the extensions, I added JSLint.Net for VS, VS Extensions for Window Library for JavaScript, and Web Essentials 2013 update 4.
... View more
07-20-2015
07:13 AM
|
0
|
3
|
1432
|
|
POST
|
Hi, I'm transitioning from the silverlight api to the the javascript api. (Reluctantly, because I really enjoy programming in C and using MVVM and XAML, way less developer plug-ins needed and easier to debug, but I digress.) I grabbed a simple sample javascript api html file from esri's site and when I open it in chrome, it works no problem. Then I tried to make this in Visual Studio 2013 (which is what I want to use as my IDE). I first added in the plug-ins listed on the esri site and created a new project with the template javascript-->Store Apps-->Windows Apps-->Blank App. I copied the html over to the default.html, but when I ran it (F5), it says "JavaScript runtime error: 'require' is undefined". I looked around the forums but the only solution listed (changing the source in the script tag from .../3.14 to .../3.14/init.js) did not work. Since I know the html works in a browser, how do I get Visual Studio to work with this api? And what template should I use for a proper website, there aren't many listed for javascript? Thanks
... View more
07-17-2015
02:09 PM
|
0
|
6
|
4847
|
|
POST
|
I think I got it to work. I had to create the grid as a polygon then use the polygon to line tool making sure the "identify and store polygon neighboring information" is checked. Thanks for all your help!
... View more
12-06-2013
11:51 AM
|
0
|
0
|
474
|
|
POST
|
I repeat the procedure with a shapefile (which still failed to work). The zipped folder of data with the network dataset and grid data is too large for me to attach unfortunately. They have a 2mb limit on zip files. Could you try to make a grid and see if you get any errors?
... View more
12-06-2013
09:25 AM
|
0
|
0
|
1494
|
|
POST
|
If I use just end points, doesn't that turn each line in a a street with no turns off of it? Meaning if I wanted to travel 100 meters east to a parallel street and I was on a north/south street, I would have to travel all the way to the end and turn twice? I don't think I am explaining that well, but I thought each overlap in this case would be a 4 way intersection so that diagonal lines could be traveled upon. I created the data with your help and if it is correct, then how I solve the problem is the issue. What I do is add the newly built network dataset to my map when prompted and make sure it is selected in the drop down in the network analyst toolbar. Then (in the toolbar) I then click network analyst-->new route. Then I click the create network location tool and add new points which are entered in as stops. When I click the solve button I get this message every time (and I've tried different locations in the network with different numbers of points and it is always the same): Warning: No route from location "Graphic Pick 1" to location "Graphic Pick 2". Error: No solution found.
... View more
12-06-2013
06:56 AM
|
0
|
0
|
1494
|
|
POST
|
I have a couple questions on how to create the network dataset for this challenge as I'm new to the network analyst (but not arcgis). This is what I'm doing now. -create a new file geodatabase -create a new polyline fishnet matching the stop points' extent and projection -create a new feature dataset within the new geodatabase with the same projection as the fishnet -add fishnet to the new feature dataset -right click the feature dataset and click new-->network dataset -take the defaults for 1st two menus -Now it asks me if I want to model turns in this network. I'm not exactly sure what that means in my context. Would the turns be the paths across the polyline fishnet? What should I put here? If yes, are the turn sources just the default global turns? -Next menu is connectivity. When I click that and the connectivity groups show up, what options do I take? Do I set the connectivity policy to end point or any vertex? There is another column with a "1" and a check box under it. Do I check that or not? -On the next menu I select None for elevation as that isn't a factor on the ocean (well, in how I need to solve this problem anyway). -The next menu asks to specify the attributes for the network dataset. A row with the name Length is there with cost for usage. Do I need to add any parameters or change anything under the evaluators button and menu? -Next is driving directions. It is defaulted to No, and the Yes option is grayed out, so I'm assuming this is ok. -Then I build the network when prompted. Is this the correct way for me to create this open area network data? I'm not sure if that is my problem or how I'm query the route solution is. Any advice is appreciated. Thanks.
... View more
12-06-2013
05:12 AM
|
0
|
0
|
1494
|
|
POST
|
Thanks, I've been trying something like that, but haven't nailed it yet. The polygon land barrier is needed because these points stretch from Gulf of Maine to the Carolinas and when I did a nearest neighbor route (calculating the closest point, drawing a line to it, then removing it from the list), I would get lines running from Jersey across Cape Cod over land. And unfortunately, our ship can't fly 🙂
... View more
12-05-2013
11:39 AM
|
0
|
0
|
1494
|
|
POST
|
Hi, I have a feature class with about 400 points that are in the ocean. I'm trying to use the network analyst extension to find the shortest route to travel to each point (as the crow flies more or less). I'm having trouble creating my network dataset. I read in another post that I should make a fishnet feature class (of polylines I'm assuming) of the whole area and use that as the roads. I would have to add a land feature class as a sort of barrier. Then I could solve the route with using the reorder option. None of the tutorials I've read have really shown me how to deal with this situation. Could someone please point me in the correct direction for solving this traveling salesman problem? Thanks
... View more
12-05-2013
07:51 AM
|
0
|
13
|
2242
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-07-2017 08:56 AM | |
| 2 | 06-09-2017 09:58 AM | |
| 32 | 07-26-2010 06:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|