POST
|
I think BEHSEINI could hack it and see what CSS gets applied if the only two options are canvas or SVG. There is a way to check to see if canvas is compatible (I think it's if (canvas.getContext) or something like that). If it is, target the canvas element to apply CSS. If not, target the SVG element to apply CSS. It looks like jQuery is the best bet to find the right dom element. I have an app that runs 3.15 showing SVG in my browser (F12). I added a layer and I drew a point. The SVG element that contains the circle element has a child g element with an ID that matches the layer name with "_layer" appended. The jquery (call it pseudo code b/c it's untested) to return the last drawn SimpleMarkerSymbol would be $(svg g#myLayerName_layer:last). I would need to F12 a canvas rendering to do the same thing but I just wanted to throw out the idea. I tested it with the supplied CSS. The result was a larger, light blue circle.
... View more
12-13-2016
06:49 AM
|
2
|
0
|
1274
|
POST
|
Hi, If I draw a shape across the dateline then edit the shape programmatically, the shape redraws the wrong way around the world (a short line from Russia to Alaska goes the long way around the world). Is that an API bug? Is it fixable with a band-aide? I saw that the JavaScript API has a bug fix for crossing the dateline coming out (or is out). Is that what is being fixed? Thank you, D
... View more
09-27-2016
08:22 AM
|
0
|
0
|
696
|
POST
|
I'd like to step in with my use case since I'm wondering the same thing. We have a FL drawn on the map. The user has the option to view the symbols in that FL (in a list box). The user has the ability to select a symbol, from a list, within a FL and select a new symbol. When the user selects a new symbol and submits, the FL is updated. In 3.x, the way we accomplish this is with layer.redraw().
... View more
05-04-2016
03:56 AM
|
1
|
1
|
1607
|
POST
|
I haven't seen anything official, but in case someone else wanted to see 4.0 ... https://js.arcgis.com/4.0/init.js
... View more
05-03-2016
04:29 AM
|
0
|
0
|
635
|
POST
|
I skimmed, but it looks like you need to call it this way: this.initializeSidebar(map). Since those objects are in the scope of the return, you'll possibly have to add "this." to other object references as well.
... View more
04-06-2016
08:00 AM
|
2
|
0
|
1503
|
POST
|
Remove "/moduleI" from your require statement. In your dojoConfig, you need to state the name of the js file unless it's "main.js". Edit: So, your dojoConfig should look like this: var dojoConfig = {
packages: [{
name: 'myCustomModule',
location: location.pathname.replace(/\/[^/]+$/, '') + '/myCustomModule',
main: moduleI
}]
};
... View more
04-06-2016
07:10 AM
|
1
|
0
|
1503
|
POST
|
I don't think you can do things like that. First, the lang.hitch maintains the context in your objects. I don't think context and scope are the same. I think hitch only keeps up with what "this" is. Second, you're calling an asynchronous function (your getDistance) that calls an asynchronous function (geo svc function). Your outside alert is going to run synchronously and won't care about the asynchronous timing of the other objects. Please see my code snippet below for how I show that dist1 remains in scope if you move things around. I have a map click to start the get distance. I have a second test button click event that alerts dist1 for the 'outside'. var dist1;
var getDistanceCallback = function(x) {
dist1 = x
alert('inside callback ' + dist1);
}
map.on("click", function(evt) {
var sReference = new SpatialReference(102100);
var newGraphic = new Point(0, 0, sReference);
var newGraphic2 = new Point(75, Math.floor((Math.random() * 50) + 1), sReference);
getDistance(newGraphic, newGraphic2, getDistanceCallback);
});
on(dom.byId('btn'), 'click', function() {
alert('button: ' + dist1);
});
... View more
04-05-2016
09:46 AM
|
1
|
0
|
777
|
POST
|
I tried messing with it for a little bit. The event geometry stays the same. I looked at the transform object of graphic-move, too. It looks like transform dx and dy may show the x/y difference from the previous starting point but there was some lacking of consistency. Sometimes there was a dx and no dy, sometimes there was neither. It's probably easier to just have a mouse-move inside of the graphic-move like the other person was saying.
... View more
04-05-2016
04:08 AM
|
1
|
0
|
1426
|
POST
|
I just created an unordered list in html for each layer on the map. You can use the API to acquire a collection of your layers and then you just use the layer's hide/show as your click event for your check boxes.
... View more
03-30-2016
11:47 AM
|
1
|
0
|
724
|
POST
|
Demystifying JavaScript Closures, Callbacks and IIFEs
... View more
03-28-2016
04:19 AM
|
1
|
0
|
777
|
POST
|
Can you post some code or a sample link? Or, you could compare your code with this example: Shapes and Symbols
... View more
03-18-2016
04:16 AM
|
1
|
0
|
357
|
POST
|
I've been working on the same thing. There is a similar thread in the ArcGIS API for JavaScript place, authored by me (yup, I am to lazy to search and link here at the moment). map.getLayer(yourLayer).geometryType gives you your geometry type... is the problem that you have a service, not the layer id that map.getLayer expects? map.getLayer(yourLayer).renderer.symbol or map.getLayer(yourLayer).renderer._symbols gives you the symbol information you'd want. You can get the fields/attributes from the identify task. It returns results, and you'd want thoseResults.feature.attributes.
... View more
03-16-2016
04:37 AM
|
1
|
0
|
593
|
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
|