|
POST
|
I'm not sure how you're implementing your service, but in general you could try changing your get to a post (but look into the fallbacks of that - I wouldn't change it without knowing what's happening else you could have unexpected results). And look into x-http-method-override. http://stackoverflow.com/questions/19771031/rest-request-cannot-be-encoded-for-get-url-too-long http://stackoverflow.com/questions/28957194/414-request-uri-too-long-marketo-rest-api-get-muliple-leads-by-list-id http://stackoverflow.com/questions/20157706/get-request-why-is-my-uri-so-long
... View more
10-16-2015
04:18 AM
|
0
|
0
|
1705
|
|
POST
|
You want to change map sliderPosition: "top-right" in your map definition if you want to start with language2. This was added in v3.3. To toggle the position, you could hack the css classNames being used by Esri onclick of your buttons. This will remove the top left class name and replace it with top right. document.getElementById("map_zoom_slider").className = document.getElementById("map_zoom_slider").className.replace(/\esriSimpleSliderTL\b/,'');
document.getElementById("map_zoom_slider").className += " esriSimpleSliderTR"; Above, sliderPosition: 'top-right' is causing the top right classname esriSimpleSliderTR to render. So, take that into consideration when you are toggling left and right.
... View more
10-15-2015
03:59 AM
|
1
|
0
|
1188
|
|
POST
|
Look at my code example above. Remove setGeometry and insert setScale, and apply the proper properties to it. That's how you programmitcally change the graphic scale.
... View more
10-13-2015
07:29 AM
|
0
|
2
|
1509
|
|
POST
|
... or maybe this is what you want for scale. http://gis.stackexchange.com/questions/121798/how-to-set-scale-range-for-a-graphic-layer-in-arcgis-api
... View more
10-08-2015
11:45 AM
|
0
|
0
|
1509
|
|
POST
|
Look here: https://developers.arcgis.com/javascript/jsapi/graphic-amd.html#setgeometry What you'll do is find your graphic object, and then it'll depend on the shape. Make it easier on yourself and var graphic = // code to retrieve the graphic you want to edit; Then you'll need to get the geometry for the shape you're editing. If it's a circle, I think it's graphic.geometry.rings. Change the rings collection, set graphic.geometry.rings = rings, and then geometry.setGeometry(graphic.geometry); The easier example is editing a point from user in put x and y. graphic.geometry.setX(4); graphic.geometry.setY(1); graphic.setGeometry(graphic.geometry); You see? You're changing the geometry then sort of setting itself with the geometry you changed. I hope that's what you meant by editing the scale.
... View more
10-08-2015
11:27 AM
|
0
|
0
|
1509
|
|
BLOG
|
I would pull out one thing and try to add it to a stand alone file. 1. Start by creating the dojoConfig file in the example above if you don't have one, and adding a script tag in your huge file to reference it. 2. Change the packages line to just one package, and create a location for it in your base root. Packages could look like this: packages: [ { name: 'whatYouReferenceYourModuleWith', location: locationPath + 'folderNameAtYourRoot', main: 'fileNameInAformentionedFolderName} ] 3. Create said folder and .js file referenced above. 4. In file in step 3, add this code: define(function() { return { lookAtMeNow: function() { return 'oh hi'; } } }); 5. In your one huge file, add this somewhere (somewhere that you know the DOM is read ... through jquery, dojo, whatever): require(['whatYouReferenceYourModuleWith'], function (whatYouReferenceYourModuleWith) { alert(whatYouReferenceYourModuleWith.lookAtMeNow) } }); In short, 1. Config file makes the modules available 2. Create a package that points to one of your files 3. Create a js file that your config points to 4. define some code for that module 5. require the module defined in step 4 by the name provided in step 2. Note: leaving off the main: 'moduleName' in the package will cause the config to look for main.js (which is what was in the original post). disclaimer: That's as baby stepped as it can be, pretty much, and I didn't test that actual syntax.
... View more
10-08-2015
10:57 AM
|
0
|
0
|
549
|
|
POST
|
You've been very helpful, thank you. Really all the answers are the correct answer, and the last two are the most helpful to me. But, per the subject, the first response answered those questions. Thank you for answering the follow-ups, too.
... View more
09-29-2015
02:19 PM
|
0
|
0
|
1791
|
|
POST
|
After messing around with the layers object a little more, I notice that map.layers.items is rather redundant. I also understand that map.layers.length is the correct way to see how many layers I have. But, I do not see how map.layers.length can be 2 (for example), and map.layers[0] is undefined. It does not seem intuitive for a developer that is not familiar with the API (including 3.x). I do understand that layers is a Collection, and I should be using Collection methods, but I'm also trying to grasp how to be fluent in the API. I see that map.layers.getAll() returns an array of objects. Does that mean that it is proper to use map.layers.getAll()[0] to reference an element of that array? And, if map.layers IS a Collection, and I have not explicitly required esri/core/Collection, is there ever a need to require esri/core/Collection or is it always going to be inherited internally through the API? Thanks again, D
... View more
09-29-2015
07:43 AM
|
0
|
2
|
1791
|
|
POST
|
1. Are there any other stand-out no-nos to consider in using the API along with underscore prefixed objects and .items on collections? It's difficult to stray from something that pops up in intellisense and provides the developer with the expected data when the developer isn't very familiar with the API to begin with. Is there ever an instance where .items is useful to the developer? I'm guessing no? Right now the only thing item returns in the 4.0 beta reference pertains to Collection. 2. I'm unable to post a live sample because limited resources unless there is an Esri play ground that I don't know about like jsfiddle? Otherwise, I'll try and whip something up on jsfiddle and cross my fingers that it renders. It's possibly irrelevant if I shouldn't be using .items at all. I will look into that farther using Collection methods. 3. In this particular example, I have a file browse for the user to select a CSV file. I convert the file to a JSON object and iterate through that object to add X, Y to the graphicLayer's graphic collection. I believe the graphicLayer is being added to the map given the code in my OP since I do see points on the map. I provide the graphicLayer an ID (not in the example above, I know, but it's there in my code). When I iterate through the JSON object, I want to check if a layer exists for that collection of points. If it doesn't exist, I create a layer for that collection. This is because I'm using a generic custom JavaScript object. I could be adding any layer type from anyone in the application. The code needs to add an item to the right Collection. This is why I want to reference the layer by ID. With that said, my pseudo code to reference the layer and it's Collection is: layer = map.getLayer(myJSONObject.LayerId) if (layer) { layer.add(graphic) } else { layer = new graphicLayer { id: myJSONObject.LayerId } layer.add(graphic) // to add the first graphic from JSON after a layer is created for it } First time through, the JSON object finds no layer associated to it so it creates a new graphicLayer. All succeeding iterations will add a graphic from the JSON object to the graphic collection in that layer. So Collections are for playing with the data and to reference the layer, I'll want to stick with map.getLayer(id). Is that about right? That's kind of (if not exactly) what I'm doing right now in code. What spawned this post is that I added several layers at once and wanted to test how many were showing on the map. I'm assuming that I could map.getLayer by Id for any of those layers. I only tested map.layers.items which returns [], so I thought something was wrong. If I don't know the Id of a particular layer, I will have to use map.layers.length so I will know the index to grab the layer by index through the Collection. Is that also right?
... View more
09-28-2015
06:46 PM
|
0
|
1
|
1791
|
|
POST
|
I would have to dig deep into the memory banks to remember the syntax. It's possibly going to be something custom. But, it's also pretty easy. If tooltip isn't supported on mouseover, I would create a div dynamically with the content being the full data of that field. So, fuzzy pseudo code, if you will... JavaScript: onmouseover="document.createElement('<div class=whatever>'+ data + '</div>')" CSS: .whatever { // size it small with a border and background color so you can make it look like a tooltip }
... View more
09-28-2015
12:22 PM
|
0
|
0
|
1532
|
|
POST
|
Try messing with width properties, not height. For what it's worth, I have no idea what width properties are available to an OnDemandGrid. Or, You could limit the data itself to a character count that you've tested to be successful. If the data exceeds the limit, you could show an ellipse with the truncated text so it looks on purpose like: Christian, Dade, Dallas, Dou... Then, mouseover, you could display the full text in a tooltip.
... View more
09-28-2015
11:58 AM
|
0
|
2
|
1532
|
|
POST
|
I would use .NET for the data-handling/reports/back-end.
... View more
09-28-2015
10:01 AM
|
0
|
0
|
481
|
|
POST
|
That really may be an MVC fail. I have a bit of a bias against MVC because I never gave it a real chance in any application I've worked on. I know enough about MVC that when we were assessing potential designs for our application, we dropped MVC because it was giving us too many fits. I'm not saying MVC is wrong, we just had no other use for it, and we were having issues. I'm sorry that I cannot be of more help on this one.
... View more
09-28-2015
08:31 AM
|
0
|
0
|
1372
|
|
POST
|
It's possible, but you're going to need to provide a little bit more information for a specific answer. Your framework/architecture play a role (potentially) in how this performs. Also, whatever else happens on your rowclick event make a difference on what you can/should do. There are large handful of methods to accomplish what you want. A few things to remember though: 1. Consider partial vs. full post back on your .NET control and how that will affect your JavaScript. In other words, look into what happens to your JavaScript on a full post back (when the page essentially refreshes for lack of better words). 2. Re: #1, Hint: You want a partial post back. You're also going to want to look at how to register client scripts in your .NET code. Registering client scripts is a way to make sure your JavaScript functionality occurs after an event fired by a .NET server control. 3. Consider not using a .NET server control and look into other avenues to display your data. Look at maybe parsing your .NET data into JSON and using a client friendly control to display your data and use an input button element for your zoomTo.
... View more
09-28-2015
07:04 AM
|
1
|
0
|
498
|
|
POST
|
Good call. My syntax for anyone else (or if someone else wants to advise a more efficient way): view = new MapView({ constraints: { minZoom: 3 } });
... View more
09-28-2015
06:50 AM
|
0
|
0
|
647
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-31-2015 06:07 AM | |
| 1 | 09-25-2015 08:35 AM | |
| 1 | 12-07-2015 04:32 AM | |
| 1 | 11-06-2015 07:47 AM | |
| 1 | 03-28-2016 04:19 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|