|
POST
|
Michael, Bookmark widget doesn't support this. Bookmark probably is the simplest task of all widgets that we created. It should be fairly easy to create your own bookmark. You don't even need a widget/dijit. Just use the dropdown that you liked (the one you linked to), and associate the onclick event of those menu items to map.setExtent().
... View more
02-13-2013
08:24 PM
|
0
|
0
|
516
|
|
POST
|
Yes, the thumb of rule is as long as there are any cross domain requests going on, you need a proxy page. I'm using version 10.03 as far as ArcServer goes. As far as domains go, they are not sitting on the same domain. I'm running the geometry service from a production server while I am doing my web application on a development server so the domains are not the same. Does that mean I need to have proxy involved?
... View more
02-12-2013
12:10 PM
|
0
|
0
|
750
|
|
POST
|
Brett, The default style of the print button has a 8px padding around it. So you have to set it as 0px to make it line up with other buttons. .esriPrint{ float: left; padding: 0px; } Glad I found this thread - I was having the same issue where the print button was adding itself above or below the toolbar next to the other tools. Adding float:left to the CSS fixed that problem. Now, though, the print button screws up the "look" of the toolbar. I have three other items added to the toolbar, all of them dijit.form.DropDownButtons, which all line up neatly when added to the toolbar. Adding the print button - I suppose since it's a "button" not a "DropDownButton" - messes with the alignment. See the attached screenshot. So far I've left the CSS of the drop down buttons the default claro style, but before I go customizing them I'd like to have the Print button match their style. Is there a way I can call in the print dijit as a .dropdownbutton instead of a .button, so the styles match?
... View more
02-12-2013
12:07 PM
|
0
|
0
|
793
|
|
POST
|
What is the version of your arcgis server where you publish your geometry service? Is it under the same domain as your web application? Please refer to this for proxy page usage. http://forums.arcgis.com/threads/77128-Export-Web-Map-Task-Error-unable-to-connect-to-map-server-only-at-the-first-time?p=272014&viewfull=1#post272014
... View more
02-11-2013
02:24 PM
|
0
|
0
|
750
|
|
POST
|
One more thing, this is not just for print service. It happens for any types of service, for example geometry service. If you are trying to reproject a geometry through a geometry service, and the domain of the geometry service has not been accessed before, the same situation will happen. It will send a call to rest info to decide if CORS is supported or not, but the first request to the geometry service will go through proxy since it doesn't know the result yet from the rest info call.
... View more
02-11-2013
02:17 PM
|
0
|
0
|
2126
|
|
POST
|
Simon, For you case, it's item 1 on the list in my previous post. You were seeing the msg in console: XMLHttpRequest cannot load http://services.arcgisonline.com/Arc...st/info?f=json. Origin http://localhost is not allowed by Access-Control-Allow-Origin. Esri JS API always sends a tentative request to test if the service supports CORS. This msg tells that you have cross domain requests, and the tests for CORS finished. Later on, when more requests for this domain, it will decided whether use proxy page or not. If your print service is not under arcgisonline.com, then before you click the print button, JS API doesn't have an opportunity to test CORS support. When clicking print, it will send the test request, but the print request doesn't wait for the result of the test. That's why the first time it will go through proxy page. And if the proxy page happens to have some problems, the first request will fail. But the next time, JS API already finished the test for CORS, it won't use proxy page any more and the request will be through successfully. Sometimes, if the test call finished soon enough before the print request, even the first time, it won't need proxy page. Anyway, as I said for item 1 in the list, always put a proxy page there for this case if CORS may be supported. So that you will not run into the issue that print service is under some domains that have not been tested. So the issue on your case is on your proxy page. As Brett pointed out that he fixed the issue just by fixing the proxy page.
... View more
02-11-2013
01:59 PM
|
0
|
0
|
2126
|
|
POST
|
Simon, Are you using your own print service hosted on your domains? or, you just use the one on sampleserver6 from arcgisonline.com? Here I'm trying to explain the detailed information about use cases of proxy page. Hopefully this will clear up all proxy page related mysteries. The sample link for item 6 is on my local machine, so that I couldn't share it. But feel free to ask any questions. The general rule regarding when proxy page is required is this: when cross domain requests are required, always configure a proxy page for the application. The ArcGIS API for JavaScript is smart enough to determine when to use it. The same origin policy is a security concept, which restricts requests made by an application to the host domain of the application. For example, if the web application is hosted on www.xyz.com, when there is any request to any domain that is not xyz.com, it is not allowed. There are exceptions to this policy: CSS, images and JavaScript loaded through link, img and script tags, respectively, are allowed to make cross domain requests. For more detailed info, refer to the following: same origin policy on Wikipedia (http://en.wikipedia.org/wiki/Same_origin_policy) same origin policy on the Mozilla Developer Network(MDN) (https://developer.mozilla.org/en-US/docs/JavaScript/Same_origin_policy_for_JavaScript?redirectlocale=en-US&redirectslug=Same_origin_policy_for_JavaScript). Below is a detailed list of common scenarios that require cross domain requests. In each case, an explanation is provided describing whether or not a proxy page will be used. In all cases, a proxy should be set up so that an application can use it if necessary. 1. If the services support CORS, (all 10.1 ArcGIS Server service should support CORS), and at the same time, if the browsers support CORS as well, it doesn�??t need proxy. Here is an example. http://help.arcgis.com/en/webapi/javascript/arcgis/samples/widget_print/index.html If using Firefox or Chrome, this application sends the print request without using the proxy page. But IEs don�??t support CORS fully, as application developers, it�??s always safe to put proxy page to satisfy all browsers. 2. Even without CORS support, for instances, ArcGIS Server 10 services don�??t support CORS, since the services support JSONP, only when the request is through POST, it needs proxy page. a. The request is through GET, proxy is not necessary. An example http://help.arcgis.com/en/webapi/javascript/arcgis/samples/query_nomap/index.html By examing the request, the query is going through an HTTP GET through a URL, you can see the response has a jsonpCallback attached to the returned json, which eliminates the usage of proxy page. b. The request is through POST, because the request is large enough to exceed 2000 characters. For example: http://help.arcgis.com/en/webapi/javascript/arcgis/samples/query_gpresult/index.html c. The request is through POST, because the request is required to be POST by server, such as editing cases where POST is mandatory. http://help.arcgis.com/en/webapi/javascript/arcgis/samples/ed_default_editingwidget/index.html For case 2.b and 2.c, the response doesn�??t have the callback parameter attached ahead of the json. In short, when JSONP + GET, proxy page is not needed. When JSONP + POST, proxy page is necessary. 3. If the response is other formats than JSONP, proxy page is always needed. An example is when loading WMTS layer, the first request is to get the capabilities XML, since the format is not JSONP, it always has to go through a proxy page to get the XML. http://help.arcgis.com/en/webapi/javascript/arcgis/samples/layers_wmtslayer/index.html You can see that the capabilities XML is got through a proxy page. (even though the sample doesn't work at this moment due to the service is down, you can still see the request through proxy). 4. When uploading files, some browsers (of course, IE) don�??t support the native uploading method, so it is always required to have a proxy page in between so that iframe can do the job of uploading. http://help.arcgis.com/en/webapi/javascript/arcgis/samples/ed_attachments/index.html 5. When generating a token through a token service, since neither ArcGIS Server 10 nor ArcGIS Server 10.1 token service support CORS, proxy page is always needed. An example is when use identity manager. 6. It is possible to force to use proxy page all the time by setting esri.config.defaults.io.alwaysUseProxy = true. For some cases, the services may be behind fire wall or other security settings, proxy is always necessary. http://localhost/localjsapi/test/alwaysproxy.html You can see all the requests to get the image tiles are through a proxy page. All of the above use cases are under the assumption that there are cross domain requests. If all the requests are to the same domain as the application, it never needs proxy page. Even putting a proxy page there, it won�??t use it. For example: https://servicesbeta.esri.com/demos/widget/widget_identitymanager.html The app is the same domain as the token service, so it ignores the proxy page setting and get the token directly.
... View more
02-11-2013
01:38 PM
|
0
|
0
|
2126
|
|
POST
|
Janice, The reason that print widget starts from a new line is that it has a div around it. Essentially, print widget is a div, which contains a dojo form button/toggle button. You can manipulate the css to get the job done. For example: .esriPrint{ float: left; padding: 0px; } This would move the print div to the left. If you want to try toolbar.addChild(), you need to pass in print._printButton. Also, you can keep the declarative way to create the toolbar, then you can get the dijit by calling dijit.byId("navToolbar"). Hope this helps.
... View more
02-06-2013
09:01 AM
|
0
|
0
|
2985
|
|
POST
|
Janice, Print widget renders itself as a dijit.form.Button. If you add it into a dijit button, it will behave as you observed. The correct way is to add it to the toolbar directly.
var toolbar = new dijit.Toolbar({},"navToolbar");
// print dijit
var printer = new esri.dijit.Print({
map: map,
url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task"
}, toolbar.domNode);
printer.startup();
In HTML
<div id="navToolbar"></div>
... View more
02-05-2013
01:35 PM
|
0
|
0
|
2985
|
|
POST
|
The input has to be in GCS. Well i am getting a similar error that Length is returning NaN. The vertices of the line features are not duplicate but still the problem is arising. 1278799.757 2755664.841 1278726.952 2755624.480 1278643.215 2755578.058 1278639.237 2755578.200 1278638.736 2755578.218 the difference is only in the decimal places but they are different. Can you tell me how to resolve this problem. thank you
... View more
01-24-2013
10:16 AM
|
0
|
0
|
994
|
|
POST
|
though it's not recommended, if you really have to avoid dojo.connect, you can simply override the event with the function as events are functions essentially. For example, you can replace dojo.connect(map, "onExtentChange", showExtent); as: map.onExtentChange = showExtent; I accept. But do u know the below code can write it on Jquery. Shall I have Jquery code for the same. dojo.connect(map, "onLoad", function() { //after map loads, connect to listen to mouse move & drag events dojo.connect(map, "onMouseMove", showCoordinates); dojo.connect(map, "onMouseDrag", showCoordinates); }); I
... View more
01-23-2013
03:54 PM
|
0
|
0
|
1658
|
|
POST
|
As John pointed out, it's not a random color palette. If you want the effect of the sample you attached, you can create a field with random values and generate the renderer based on it.
... View more
12-10-2012
12:01 PM
|
0
|
0
|
731
|
|
POST
|
Mark, You can adjust the width of bookmark/bookmark item/bookmark label by setting the CSS: .esriBookmarkLabel{ width: 200px; } .esriBookmarkEditBox{ width: 200px; } .esriBookmarkTable{ width: 274px; } .esriBookmarks{ width: 280px; } .esriBookmarkItem{ width: 280px; } Hope this helps.
... View more
11-30-2012
01:44 PM
|
0
|
0
|
429
|
|
POST
|
3.3 will add support for customTextElements in PrintTask. Thanks.
... View more
11-19-2012
04:26 PM
|
0
|
0
|
1701
|
|
POST
|
That's in the plan that JavaScript API will support labeling on client. But we don't have a specific timeline at this moment.
... View more
09-13-2012
02:37 PM
|
0
|
0
|
592
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 06-21-2013 01:17 PM | |
| 3 | 07-15-2013 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|