POST
|
Hi, the code you posted should show the second point not the first. But that doesn't matter ... you are setting the map's extend every time when you add a point theirfore you won't see all points you've added. You can do 2 things to see all points: - Add every point you add to the map additional to a polygon. After all points are added set the extent to the geometry of this polygon. - Save the coordinates of the points in xmin,ymin,xmax,ymax variables (if they are min or max) and after you have added all points build an extent out of this 4 variables and then set the map extent. Hope that heplsp. Greets, Tol
... View more
05-04-2011
03:09 AM
|
0
|
0
|
172
|
POST
|
Hi, function doBuffer(evt) { var globals = dojo.disconnect(map, "onClick", doBuffer); ... } <button type="button" onClickConnect = dojo.connect(map, "onClick", doBuffer);>Click [/SIZE] Change this 2 lines in your code to .... <input type="button" onclick="globals = dojo.connect(map, 'onClick', doBuffer); " value="Click Me!"> and function doBuffer(evt) {
dojo.disconnect(globals);
...
} A little bit explained .... you need the global var globals for saving a handle to your eventhandler. Assign (=> globals = dojo.connect(etc)) the eventhandler when you click on the button and disconnect the handle when the doBuffer method is calls (=> dojo.disconnect(globals)). Hope this will help this time .... Further you should really start reading some JavaScript related artikels about scope and about dojo eventhandling or simply the dojo API. Greets Tol
... View more
02-18-2011
12:27 AM
|
0
|
0
|
389
|
POST
|
Hi, I'm a little bit confused about your code but I'll try to explain what you should do when you try to de/activate some functionality with buttonclick ... Connect your button button with onclick handler for the map ... e.g.: <button onclick="javascript: eventhandle = dojo.connect(map, ev, fun)"> fun = function(event) { //place business logic here => e.g. doBuffercode dojo.disconnect(eventhandle); //disconnect this evenhandler => only one buffering is done ... you can place this line of code on antoher button or wherever you want to trigger the deactivation } The code you wrote doBuffer.deactivate() should do nothing because doBuffer is a function itselfe and not a object you can call a function on. In the esri example the activate() and deactivate() functions are called on the drawtoolbar object. I think you mixed those things up. Hope that helps .. if not post more of your code. Greets Tol
... View more
02-17-2011
12:52 AM
|
0
|
0
|
389
|
POST
|
Hi, I faced 2 problems when I tried to implement some features in my application today. Let me describe what I tried to do. I intend to create a label and the rotate the label after creation. E.g. for labeling a street or a river in the right angle. I though about the following steps to complete this goal: Draw an textsymbol on the map and then hand it to the editortoolbar to totate the graphic (by user). First problem I faced was that I could not include or require the esri.toolbars.edit cause I'm loading the API localy .... in detail arcgis_compact version cause I don't use dojo for my GUI. If I include dojo.require(...edit) i get following error log:
"NetworkError: 404 Not Found - http://***/scripts/arcgis_compact/js/esri/toolbars/_GraphicMover.xd.js"
_Graph...r.xd.js
"NetworkError: 404 Not Found - http://***/scripts/arcgis_compact/js/esri/toolbars/_VertexEditor.xd.js"
And subsequent cross domain loading errors when I try to init the toolbar, but that sounds ok if the lib is not loaded properly. I searched these files and they aren't in this dir ... or they are named in another way ... not capitalized as they are in the errorlog (e.g. _vertexEditor.xd.hs). Renaming does not help. So here is the first question ... does so know where the problem is here. I thought a lot about it, but didn't get an idea what might cause this issue. After that I loaded the online sources and the error was gone and I tried to rotate my graphic ... which is a point with a textsymbol. Ok next error saying somethink like ... wrong geometry type ... can't activate editortoolbar. Question here is if I can rotate points with textsymbols ... the API does not prohibit spezial geometries for rotation. If so knows details here I would be thankful for input. Further if so knows another way to complete my goals please feel free to contact me 😉 Sidenote: I know that I could rotate the text with .setAngle() but that's not what I intend to do ;). Further I need to use local resources the app might run in intranet without internet connection. Greets and thanks in advance, Tol
... View more
02-16-2011
05:49 AM
|
0
|
1
|
457
|
POST
|
Hi, your answer is already answered but I have another point on these tooltips. A nice feature for the tts would be a built in way for l10n and not only the posibility for turning a tt on or off. Sure ... setting up a custom tt on a mouseover is not that hard to code, but I think l10n in tt's would be a commonly used feature. Are there any plans on this for future versions? Greets Tol
... View more
02-16-2011
12:16 AM
|
0
|
0
|
269
|
POST
|
Hi, try to link your checkboxes or whatever you use with an event handler ... e.g. 'checkchange'. If you have a dynamic TOC you should give each TOC entry an id, in this case best id is the service id. Save alle services/layers in an array. If checkchange fires you can do something like this:
//Listener on an ExtJS Component
listeners: {
'checkchange': function(node, checked){
if(checked){
node.getUI().addClass('complete');
var size = node.parentNode.childNodes.length;
for(var i=0;i<size;i++) {
if(node.parentNode.childNodes.id != node.id) {
node.parentNode.childNodes.ui.checkbox.checked = false;
Ext.getCmp('mappanel).setLayerVisibility(node.parentNode.childNodes.id, false);
}else {
Ext.getCmp('mappanel).setLayerVisibility(node.id, true);
}
}
}else{
node.getUI().removeClass('complete');
}
}
}
//function definition in ExtJS
setLayerVisibility: function(id, visible) {
var size = this.oLayer.length; //in this array all layers/services are saved
for(var i=0;i<size;i++) {
if(this.oLayer.id == id) {
if(visible)
this.oLayer.show();
else
this.oLayer.hide();
}
}
}
With this example you activate only one layer/service at a time ... i just c&p parts from an ExtJS sample of mine and didn't alter it to a common example ... you might have to change some parts. Summary ... give TOC an evhandler and show/hide layers linked via id to the TOC. Hope that helps a little bit ... greets Tol
... View more
02-10-2011
01:00 AM
|
0
|
0
|
326
|
POST
|
Hi, as far as I know geoprocessing tasks are not handled in JavaScript ... you build a task or lets call it query with JS and pass the query to the AGS (thats the JS part). The server is handling the request and sends you a callback. I may be wrong here but if you need custom geoprocessing that the server can't handle you might have to implement an AGS extention with your own business logic. Greets Tol
... View more
02-09-2011
09:57 PM
|
0
|
0
|
491
|
POST
|
Hi, the features you describe are not magic but a little bit of work 😉 At the beginning on a project like this I'd start to implement a user management ... a configuration software that manages a list with users and the services they are allowed to see/use. In a second step you can code your client in a way that he gets a configuration file from the user management and connects to the services which are handed over. Here is a little security issue, cause we didn't account yet that AGS rest services are not secured per se -> the access control must be done seperate ... but that's another point. Step tree would be to implement an interface at your user management that has the capability to save e.g. bookmarks or the extent the map is and send them to the um when the user is logging out of your application. This information can be put in the configuration file for the next user session. And here we are ... you can extend this approach for your needs. One sidenote at the end of my post ... this aproach has primairy nothing to do with the JS API but can be used ^^ I'm not sure if an user management will be part of the API in some time but atm I see no other way to do what you described. There might be other ways to get parts of this done e.g. config an extra service for every user with it's own layers and secure the service wie proxy and token passing that only this user can access it (no bookmarks but restrictions on operational layers) etc. but the other aproach is more generic and extendable for larger projects. Greets Tol
... View more
02-09-2011
06:18 AM
|
0
|
0
|
321
|
POST
|
Thanks for the answer Jian, is there something like a roadmap for the JS API, with release dates and planed features? There are some other features (i.e. snapping while editing geometries) I'd like to have in my application and it would be interesting if I have to code them myself or a future release would bring this features. Thanks Tol.
... View more
02-07-2011
09:33 PM
|
0
|
0
|
325
|
POST
|
Hi, I have written an application that should measure the geodesic distance between the points of a polygon while creating the polygon (DistanceParameter) and when the polygone is finished the complete extent und area (both again geodesic) of the polygon should be computet. I've tried AreaAndLengthParameter, but there is no way to compute the geodesic area and extent with this function/parameter. Unfortunatly I haven't found another way to compute the geodesic area with a GeometryService. Is there another API-function that I didn't notice to compute the geodesic area and extent of a geometry or do I have to compute it myself? Thanks in advance ... greets Tol
... View more
02-07-2011
02:23 AM
|
0
|
3
|
1190
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|