POST
|
-- Using version 3.7 of the flex API I've got a button in the map info window which when clicked will trigger the draw tool to start drawing a new polyline geometry. When this button is clicked everything works except for the tool tip which lets the user know how to start drawing (e.g. "click to add a point, double click to finish drawing"). I believe this issue has to do with the cursor already being over the map & not triggering a function that is possibly linked to a mouse in event on the map itself. The reason I think this is that when I mouse out of the map with draw active and then mouse back in the tool tip displays properly. Is this a known issue by chance or is there a setting I'm not using? Any help would be appreciated. - Jamie
... View more
01-14-2015
08:32 AM
|
0
|
0
|
3972
|
POST
|
I'm assuming there isn't a proper way to do this yet. As a workaround I added some listeners to see if the user moves the mouse at all. If they don't then I just take the centroid of the geometry that is drawn. Here is the code: Local variables: var mouseMovedAfterDown = false; var mouseDownHandler = null; var map = null //this is setup elsewhere. Function to determine if the mouse has moved: // some geometries will automatically draw at a set size relative to the current map scale if the mouse isn't moved. // We don't want this to happen though, to avoid it we add these listeners and get the drawn geometry's center when that occurs. var watchMouseMoveAfterDown = function () { var mouseLocation = null; function mouseDown(event) { mouseMovedAfterDown = false; console.log("mouseMovedAfterDown = false"); mouseLocation = { x: event.clientX, y: event.clientY }; jQuery(document).on("mousemove", mouseMove); console.log("mousemove added"); dojo.disconnect(mouseDownHandler); if (!rootScope.$$phase) rootScope.$apply(); } function mouseMove(event) { if (event.clientX !== mouseLocation.x || event.clientY !== mouseLocation.y) { mouseMovedAfterDown = true; console.log("mouseMovedAfterDown = true"); jQuery(document).off("mousemove", mouseMove); console.log("mousemove removed"); if (!rootScope.$$phase) rootScope.$apply(); } } if (mouseDownHandler) dojo.disconnect(mouseDownHandler); mouseDownHandler = dojo.connect(map, "onMouseDown", mouseDown); }; Before activating the draw tool: watchMouseMoveAfterDown(); in the "onDrawEnd" handler: if (!mouseMovedAfterDown && geometry.type !== "point") { geometry = geometry.getCentroid(); }
... View more
06-26-2014
01:59 PM
|
0
|
0
|
355
|
POST
|
Has anybody come up with a solution for panning the map with the middle mouse button? I'd like to be able to add support for this in my application (users want it as it is in ArcMap) but I don't think it is built into the API. My current plan is to add one mouse listener for mouse down (and check that it is middle mouse) that when triggered will add two other mouse listeners for mouse move and mouse up (mouse up doing middle mouse check again). The mouse move listener will trigger a map.panTo() with the current screen position. The mouse up listener will do clean up and stop the panning. Has anyone tried something similar? Thanks, - Jamie
... View more
06-12-2014
07:26 AM
|
0
|
0
|
679
|
POST
|
Yes but your code modifies the symbol of the graphic. The geometry I draw doesn't even get a symbol; I need some way of modifying the draw tool directly to set a default geometry size for shapes you can just click the map to draw (listed & shown in my initial question).
... View more
06-12-2014
06:17 AM
|
0
|
0
|
355
|
POST
|
Thanks for the sample Tim. I don't think that is it; from what I can tell you are making changes to the graphic's symbol after the geometry has been drawn. If this was a visual issue then I think it would solve my problem but I need to change the geometry being sent in the query. - Jamie
... View more
06-11-2014
01:20 PM
|
0
|
0
|
355
|
POST
|
When you click to draw predefined shapes such as Triangles, Circles, Arrows, and Ellipses (As shown by this example) there is a default size that they get created at. Is there any way to customize this? We allow the user to perform a selection by clicking like this and do not show the select geometry on the map. In cases where they are on one of these tools the returned results are very misleading. In other words if the user just clicks expecting to select with a point they will actually be selecting with a polygon generated with a much larger extent but have no way to see this. Thanks, - Jamie
... View more
06-10-2014
02:59 PM
|
0
|
5
|
859
|
POST
|
Hey Manish, The 3rd option you provided worked great. I'm not sure what is up with the API in IE 10 but I stopped the code before setting the showTooltips = true & in IE it was actually false (chrome and I'm assuming others have it true). One caveat to doing this is that it doesn't work if you try to pass in {showTooltips: true} as the options. It also didn't work if I tried to set it immediately after calling the constructor. I ended up doing it later on in the process; immediately before calling activate. Thanks for the suggestions! - Jamie
... View more
05-29-2014
06:56 AM
|
0
|
0
|
315
|
POST
|
When I activate the draw tool in IE9, firefox, or chrome everything works fine and I get the tooltip message showing up ( e.g. "click to add a point"). In IE 10 that is not the case; drawing still works but the tooltips are missing. Does anyone have an idea on how to fix this? My current plan is to just manually show my own tooltip through other means but I would rather not have to do all that to fix a bug specific to 1 version of one browser. Sorry if this is a re-post. I know I've seen this issue mentioned online before but I'm having a hard time finding it again. Thanks, - Jamie
... View more
05-28-2014
02:19 PM
|
0
|
3
|
743
|
POST
|
Well I don't have too much to add to this. The fix for me was to recreate the layers in ArcMap 10.2. I compared the new layers vs the old ones in the Rest API and I couldn't see any difference but in the end the entirety of the problem was unrelated to the JavaScript API.
... View more
05-01-2014
01:46 PM
|
0
|
0
|
167
|
POST
|
Sorry for the vagueness of this question, I just started looking into it and haven't found much information yet. A bug has appeared in my featureLayer saving code after updating our servers to 10.21 from 10.0x and our JavaScript API from 3.7 to 3.8 I'm wondering if anyone else has encountered something similar or if there is any information out there on what may have changed with featureLayer.applyEdits() Here is my current process of what is happening (this used to work before, I can't guarentee the upgrades to 10.2 and 3.8 were the problem, this code hadn't been tested in a couple months): Draw a Polygon on the map Polygon gets added to adds array applyEdits request is sent to the server response comes back something like "[undefined,[],[]]" where undefined = the adds response (the others are empty as expected... No updates or deletes performed) Any suggestions? I'll add on to this with any other information I come up with. Thanks, - Jamie
... View more
04-30-2014
02:14 PM
|
0
|
1
|
434
|
POST
|
My original question here had the actual bug omitted from it. The root cause of my error was that I used "!=" instead of "<>" for not equals in my layerDefs. Here are my test cases for those interested; there are a couple differences between 10.0 and 10.2 Note: - I removed the samples from each test but kept pass/fail & the key parts that differentiated. - TEST 1 & 2 are in the format sent by the REST API - I was using test 2 in my code which caused the issue for me (needed to switch to test 1 format) - I don't think I've included all cases, there are probably at least 2 tests I missed here that weren't relevant. ************************** 10.0 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator)) TEST 2 - PASS (JavaScript API will send like this (using != as operator)) TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" ) TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" ) TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" ) TEST 6 - FAIL ( wrapped in curly braces, separated by commas, and not equals operator: "!=" ) ************************** 10.2 TESTING ************************** TEST 1 - PASS (JavaScript API will send like this (using <> as operator)) TEST 2 - FAIL (JavaScript API will send like this (using != as operator)) TEST 3 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "<>" ) TEST 4 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" ) TEST 5 - FAIL ( wrapped in curly braces, separated by semi-colons, and not equals operator: "!=" ) TEST 6 - PASS ( wrapped in curly braces, separated by commas, and not equals operator: "!=" )
... View more
03-28-2014
01:30 PM
|
0
|
0
|
236
|
POST
|
That example doesn't appear to have one. The map is setup with a base map only & then buffering is done on client-side shapes so it doesn't have a need for a dynamic map service. I believe this example shows how to add one.
... View more
03-20-2014
11:13 AM
|
0
|
0
|
512
|
POST
|
We are currently upgrading from a 10.0 to a 10.2 server and are having issues with one of our apps built in JavaScript. The JavaScript API is generating an export map call with layer definitions setup like: 6:(USERNAME = 'test');7:(USERNAME = 'test') Which works fine in 10.0 but fails in 10.2. I looked at examples in the documents and found one here which shows that the request should be sent with the parameter like: {6:(USERNAME = 'test'),7:(USERNAME = 'test')} Note that it is wrapped in curly braces and layers are separated by commas instead of semi-colons. To setup these definitions in the code all I did was (not the exact code): var definitions = []; definitions[6] = '(USERNAME = 'test')'; definitions[7] = '(USERNAME = 'test')'; service.setLayerDefinitions(definitions); Anybody have any thoughts on what I might be doing wrong or if this could be a bug in the api? NOTE: 10.0 api works with commas instead of semi-colons but fails when wrapped with curly braces. 10.2 only works with semi-colons and must be wrapped with curly braces Thanks, - Jamie
... View more
03-20-2014
11:09 AM
|
0
|
2
|
538
|
POST
|
I don't think it is possible to set a variable to false to ignore the click events. There are a couple things I think you could do though: 1. Create your own boolean that gets set to true when measure becomes active (false on deactive) & add an if statement to your identify click handler 2. Create setup/teardown functions for each tool that get called before you start drawing on the map. These will: setup: create an event listener and store a reference to its disconnect function (this is returned when an event listener is created) teardown: use that listener's return function to remove the listener
... View more
02-12-2014
07:13 AM
|
0
|
0
|
284
|
POST
|
Thanks Swingley, it didn't occur to me to check the rest API.
... View more
02-03-2014
05:47 AM
|
0
|
0
|
669
|
Title | Kudos | Posted |
---|---|---|
1 | 01-24-2014 07:21 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|