POST
|
const ARCGIS_CERLE_ISSUE_FIXER = 111500;
const circle = new Circle({
spatialReference: mapView.spatialReference,
center: event.vertices[0],
radius: desiredRadius * ARCGIS_CERLE_ISSUE_FIXER,
}); is working fine enougth to me
... View more
08-08-2018
06:26 AM
|
0
|
0
|
1830
|
POST
|
I just tried with different zoom and the visual size of the circle change as the scale of the view change, so it must be an issue with the radius only (and may be "fixed" by finding the good "meter radius --> buggy meter radius" ratio, waiting for the issue to be properly fixed).
... View more
08-08-2018
05:19 AM
|
0
|
1
|
1830
|
POST
|
I try to create a simple Circle, taking example on the polygon drawing sample code: Code simplified for the example: const action = draw.create('circle', {});
action.on('vertex-add', (evt) => this.createCircleGraphic(evt));
action.on('cursor-update', (evt) => this.createCircleGraphic(evt));
action.on('draw-complete', (evt) => this.createCircleGraphic(evt)); and function createCircleGraphic(event) {
mapView.graphics.removeAll();
const circle = new Circle({
spatialReference: mapView.spatialReference,
center: event.vertices[0],
});
const graphic = new Graphic({
geometry: circle,
symbol: // my symbol,
});
mapView.graphics.add(graphic);
} But at first the circle was not visible (even at the maximum zoom). By looking at the devtools, I saw that the extent's dimensions was smaller than 0.001 px... I could make the circles appear by specifying a radius of 10'000'000 meters, which make me think that something is working wrong... With the devtools I could see that right after instanciating the circle object, it's spatialReference was wrong. I can reset it right after, and then it become ok, but I dont know if this has any link with the issue... Did I miss something ?
... View more
08-08-2018
05:02 AM
|
0
|
2
|
3041
|
POST
|
I'll try it monday, thank-you very much !! EDIT: It work just fine, thank you !
... View more
06-05-2016
04:34 AM
|
0
|
0
|
2259
|
POST
|
Thanks for your answer ! In my case, the maps layers can change very often, so I could handle every cases and query the right thing, but in a sens, it duplicate the code that is already writted in the ArcGIS API. Anyway it would have been a good way in an other case than mine, so thanks !
... View more
06-05-2016
04:34 AM
|
0
|
0
|
2259
|
POST
|
(Please excuse my english) I need to simulate a user mouse click on the map. I tried with this kind of method but it seem not to work: http://stackoverflow.com/questions/6157929/how-to-simulate-a-mouse-click-using-javascript I think it's because a script-lauched mouse click is an untrusted event and ArcGIS only listen to the trusted event (launched by an user). I need it because my map is in an invisible iframe, and i send the click coords to it from the main page. How could I do this ? (nativ method ? JS hack ? I looked for it but found nothing...) Thank you in advance for yours answers, Robin Chappatte
... View more
06-02-2016
05:26 AM
|
1
|
4
|
6957
|
POST
|
(Please excuse my english) I have to display a "deformed" map, eg display a square geographic zone as a rectangle. I searched few days on internet and in the documentation, but i didn't find anything... Is there a way to change the aspect ratio of the map ? Thank you in advance for your answers, Robin Chappatte
... View more
06-01-2016
05:11 AM
|
0
|
0
|
1617
|
POST
|
After several tests, the only thing I can suppose is that the browser take time to display the tiles, and the attribute updating goes to false as soon as the layer received the data, regardless of whether they are displayed. My solution consist in adding a setTimeout between the "isReady" and the printing launch: function waitReady() { if (isReady()) { window.setTimeout(function() { window.print(); }, 100); // 100ms of security for letting the browser display } else { window.setTimeout(waitReady, 10); } }
... View more
05-26-2016
12:09 PM
|
0
|
0
|
520
|
POST
|
Sorry to set back this thread as unresolved but after many tests I detect bad case where the print is launched but tiles still missing... By setting the timeout to a lower value, it fails more often... So I don't give up and still looking for a way to detect it
... View more
05-26-2016
11:34 AM
|
0
|
0
|
520
|
POST
|
Thank you for your answer ! Actually, my work consist in adapting an existing project made with OpenLayer to use ArcGIS instead. To make the best documentation possible, I want to face a maximum of solutions for each difficultie I encounter to make it easily maintainable if an other student have to resume it (and every option made me learn a little bit more about the web developpement )
... View more
05-26-2016
10:05 AM
|
0
|
0
|
722
|
POST
|
(Please excuse my english) I have to restrain my users to pan and zoom from the current view when they hit a button (they switch from navigation mode to edition mode). I found that it was possible in the version 3.16 (Map navigation | Guide | ArcGIS API for JavaScript ) I look into the Functionality matrix | ArcGIS API for JavaScript 4.0 and saw that "Enable/disable navigation" were coming soon, but I need it to work for the next month (diploma work)... A potential (and temporary) solution (waiting for the feature to release officially), would be to add an invisible layer over the map to get clicks and the drags and only follow the clicks to the map, but maybe there is a better solution ? (And maybe my bad understanding of english made me miss or misunderstood something...) Thank you in advance for your answers, Robin Chappatte
... View more
05-26-2016
09:35 AM
|
1
|
3
|
1723
|
POST
|
Thank you ! I also have to check if the layers were created (otherwise it considered the map as ready when there where no layers in the list): function isReady() {
if (view.allLayerViews.length == 0) {
return false;
}
for (var i = 0; i < view.allLayerViews.length; i++) {
if (view.allLayerViews.items.updating) {
return false;
}
}
return true;
}
function waitReady() {
if (isReady()) {
window.print();
} else {
window.setTimeout(waitReady, 10);
}
}
... View more
05-26-2016
05:33 AM
|
0
|
0
|
520
|
POST
|
(Please excuse my english) I have to fire a 'window.print()' when the map is entierely displayed in the browser. I tried to use 'view.then()' but the map is still not displayed when the 'then' event occure... My solution is to use 'setTimeout' in the 'then' event, and to wait 1 second, but that doesn't sounds correct to me to do this... Is there a way to know / detect / check is the map is correctly displayed ? Thank you in advance for your answers, Robin Chappatte
... View more
05-26-2016
04:12 AM
|
0
|
4
|
1433
|
POST
|
Thank you for your answers, I tried to print a page with only a map with the size of a A4 sheet and it work just fine, I now need to find a way to clone / copy a map from a normal page (with other elements that the map) to an empty page, I'll open a new thread for that (Is there a way to clone / copy a map (all layers included) ? ).
... View more
05-20-2016
03:33 AM
|
0
|
0
|
625
|
Title | Kudos | Posted |
---|---|---|
1 | 05-20-2016 03:32 AM | |
1 | 06-02-2016 05:26 AM | |
1 | 05-26-2016 09:35 AM |