|
POST
|
I need to set max zoom level for map because in some places in doesn't have detailed information data. How better to do that? I'm using Drupal And this is my code in js var map = new esri.Map(id, config.options); var mapLayer = new esri.layers.ArcGISTiledMapServiceLayer('//server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer'); map.addLayer(mapLayer); Any Ideas? Since it is a tiled map service, you could use map's lods property to control the zoom level. ESRI have a sample for this: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/map_customtilelevels.html
... View more
06-13-2012
06:59 AM
|
0
|
0
|
567
|
|
POST
|
hi, can someone help me, i just want to get value from infowindow .for example from code below i just want input id="name" and input id="address" get value from infowindow when i click the layer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html debug=true> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Query Task - Stylize Feature Set with InfoWindow Tabs (Polygon)</title> <script src="http://maps.google.com/maps?file=api&v=2&key=DioG219lPJG3WTn3zmQqebsjVg" type="text/javascript"></script> <script src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6" type="text/javascript" ></script> <script type="text/javascript"> var gmap = null; var qtask = null; var query = null; var mapExtension = null; var gOverlays = null; function initialize() { // GMap construction gmap = new GMap2(document.getElementById('gmap')); gmap.addMapType(G_NORMAL_MAP); gmap.addMapType(G_SATELLITE_MAP); gmap.addControl(new GLargeMapControl()); gmap.addControl(new GMapTypeControl()); gmap.setCenter(new GLatLng(33.97142760360439, -117.3805046081543), 17); // RIVERSIDE (Polyline, Polygon) gmap.enableScrollWheelZoom(); //Create MapExtension utility class mapExtension = new esri.arcgis.gmaps.MapExtension(gmap); // Query Task qtask = new esri.arcgis.gmaps.QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/1"); GEvent.addListener(qtask, "executecomplete", function() { //console.debug("'query task complete' event fired!!!"); }); // Query query = new esri.arcgis.gmaps.Query(); } function executeQuery() { var cent = gmap.getCenter(); var bounds = gmap.getBounds(); // clear gOverlays overlays and event listeners mapExtension.removeFromMap(gOverlays); // set query parameters query.queryGeometry = bounds; query.returnGeometry = true; query.outFields = ["POP2000","POP2007"]; // execute query task qtask.execute(query, false, mycallback); } function mycallback(fset) { //JS literal class esri.arcgis.gmaps.OverlayOptions var overlayOptions = {strokeColor:"#FF0000",strokeWeight:1,strokeOpacity:0.75,fillColor:"#000066",fillOpacity:0.2}; //JS literal class esri.arcgis.gmaps.InfoWindowOptions with tabs var infoWindowOptionsTabs = { content: "<table>" + "<tr><td>Name:</td> <td><input id ='name' value='{POP2000}'/> </td> </tr>" + "<tr><td>Address:</td> <td><input type='text' id='address' value='{POP2007}'/></td> </tr>" }; gOverlays = mapExtension.addToMap(fset,overlayOptions,infoWindowOptionsTabs); } </script> </head> <body onload="initialize();" onunload="GUnload();"> <table width="100%" height="100%"> <tr> <td align="center"> <table> <tr align="left"> <td> <input type="button" value="Execute Query" onclick="executeQuery();" /> <input type="button" value="Clear Map Overlays" onclick="mapExtension.removeFromMap(gOverlays);" /> </td> </tr> <tr align="left" valign="top"> <td> <div id="gmap" style="width: 450px; height:450px;"></div> </td> </tr> </table> </td> </tr> </table> <p> name<input id="name"/>address<input id="address"/> </p> </body> </html> One approach you could try is to embed a javascript function into the infowindow as a link and pass name and address as the parameters into the function (user has to click the link).
... View more
06-12-2012
10:27 AM
|
0
|
0
|
521
|
|
POST
|
Thanks a lot Zhu, That worked for me.. where can i get such methods described? I was looking here http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm Under API Reference Tab looking for Geometry -> Extent.
... View more
06-12-2012
06:05 AM
|
0
|
0
|
1958
|
|
POST
|
Thanks for the prompt response. Regarding what the geometry service (called using esri.tasks.GeometryService) should return: if passed a single geometry with the proper inner ring orientation (1st input) and an array of geometries (2nd input), the returned result is NOT expected to exclude the points that appear within the hollow area? It would be great if we can get some sample code that returns the proper intersection result instead of excessive validation and proceesing client-side to do the same. what you can do is create a geometry out of the interior ring and do the interaction with the point...
... View more
06-11-2012
11:20 AM
|
0
|
0
|
1678
|
|
POST
|
Hi, Is there a way to determine the time when a record was last modified/created through a query? Thanks. If you stored the information in a field (through web api or through DB like update trigger), then you will be able to retrieve it.
... View more
06-11-2012
10:49 AM
|
0
|
0
|
701
|
|
POST
|
Hi all, I have an editing web service that work's fine, except from two problems I can't resolve: 1) The order/sorting of subelements (that has been defined in the advanced symbology dialog of the mxd-document) within one feature layer does not appear correctly in the editor panel - the elements are unsorted. 2) The reference scale, set in the mxd-document, doesn't work either in the web service. Both problems don't occur in the "normal", non-editing web services - only when working with the editor widget and feature layers. Are these non supported functions when working with feature layers or ArcSDE feature classes? Thanks in advance! Does this happen when you set up a featurelayer through map service (like: /mapserver/0)?
... View more
06-11-2012
10:39 AM
|
0
|
0
|
791
|
|
POST
|
The idea is simple. Given a hollow polygon as geometry A and an array of point geometries, we would like to figure out the proper intersection between the two. Below is the code used: var geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var relationParams = new esri.tasks.RelationParameters(); relationParams.geometries1 = [hollowPolygonGeom]; relationParams.geometries2 = [point1geom, point2geom, ..., pointXgeom]; relationParams.relation = esri.tasks.RelationParameters.SPATIAL_REL_WITHIN; geometryService.relation(relationParams, onSuccess, onErr); The results returned by the service include the intersection between the "hollow" are of the polygon and the points. We also noticed that the orientation of the inner ring (the hollow shape) affects the returned results. Either way, the results are not what we wanted. Is this behavior expected? What are we missing? Is there another way to get the results we need? Thanks in advance! In ArcObjects, counter clockwise ring is an interor ring -hollow. In JSAP, you could use esri.geometry.isClockwise(ring) to validate if it is a hollow ring (hole). It is useful when you do intersection. For example, if the hollow ring contains the array of the points, then the polygon is not intersect with the points !!
... View more
06-11-2012
10:30 AM
|
0
|
0
|
1678
|
|
POST
|
I've built a web application that uses a GP service to extracts data (using a modification of the Clip and Slip) using the ArcGIS for Javascript API. The GP service works via URL and within ArcGIS Desktop. When I try to submit a job through the application, a single GET request is made to my server and I get the error: "Error submitting job..... code 500." I'm using HTTPFox to watch the traffic between browser/server. Note: I'm submitting the required parameters and I believe I am referencing the correct URL to the GP service "<servername>/ArcGIS/rest/services/GPServer/<toolname>" Melo, the error message "Error submitting job..... code 500" is too generic to figure out exact where the gp went wrong except that this is a Server issue (again it could be web server or ags server issue). What you usually want to do it testing your gp tool on desktop environment, then publish on the server...
... View more
06-11-2012
08:22 AM
|
0
|
0
|
639
|
|
POST
|
It seems the issue is missing where statement query.where but as i read its not mandatory. Anyone care to enlightening me about this please. thank you Either specify a spatial filter or attribute filter (even through you want to retrieve all the records - use something like query.where ="1=1").
... View more
06-11-2012
07:15 AM
|
0
|
0
|
2273
|
|
POST
|
Hi, I have two external button for zoomin and zoom out. on click of zoomin button i am using map.centerAndZoom() function. But it doesnt work for me. i want the extent to be maximixed and minimized.. when use this, map.centerAndZoom((0,0),1) map.centerAndZoom((0,0),2) map centers to one position.. how do i make it dynamic.. i.e., on click on button it should keep zooming in.. and similarly the zoom out button as well what other functions for the same can i manifest? Try this: For ZoomIn Button: var extent=map.extent; map.setExtent(extent.expand(0.5)); For ZoomOut Button: var extent=map.extent; map.setExtent(extent.expand(2));
... View more
06-11-2012
06:58 AM
|
0
|
0
|
1958
|
|
POST
|
Stephen, I'm pretty sure the geometry of the map div affects how the extent is set when you call map.setExtent(extent, fit?). The API should center your extent in the available area of the map unless you're locking down scales or levels of detail. After setting the extent, I expect the map object's extent property to contain the actual extent, not necessarily the one specified. The maps we build here usually are not a fixed size, so our scripts confirm the initial map extent by setting it again after all the layers are loaded, because the map doesn't really finish loading until the first layer is added to the map. Just to be safe, after the initial extent is set, you could grab the current extent and store it to make sure if you still want to compare extents. After the layers are loaded and the initial extent confirmed, we set up the onExtentChange event handler, and it catches all extent changes after that. But we don't do any later comparisons, because we just cache the extents so the user can go back and forth in the extent history. I'm with you on the global variables. If you want to cut down on that, you can create one global object and store event handlers as members of that object. We wrote an EventHandler class to store layer event handlers on one array, map event handlers in another, and so on. How about use if (currentExtent.contains(initialExtent) && currentExtent.intersects(initialExtent))?
... View more
06-09-2012
01:43 PM
|
0
|
0
|
1165
|
|
POST
|
Ben, Thanks for the reply. Option 2 is the way I was thinking of going for this project but wanted to poke around a bit before. Great explanation on the API, map domNode and image retrieval as well. sometimes I forgot to think about that stuff when I'm wrapped up in a project. How about create a featurelayer for each polygon layer in the map services and control featurelayer 's opacity(Layer) value?
... View more
06-09-2012
01:30 PM
|
0
|
0
|
1531
|
|
POST
|
Hi everybody, I successfully installed the API locally on a server called A. I use them in a web page that resides on another server called B. When I open that webpage I get the following error: ...Could not load cross-domain resources... What's the problem? I supposed the CORS shuldn't be a problem, since usually the APIs used for the ESRI demos are hosted on a different server from the one on that the demo page (that uses them) resides. Thank you very much. The issue most likely is you src not pointing to the right place (for example: <script type="text/javascript" src="http://yourwebsit/arcgis_js_api/library/2.8/jsapi/"></script>). Tried to click the src link. If the src is right, a file download window should popup to prompt you open or save jsapi.js file. OR if you local api has different domain from your app. Then dojo.require (esri.xxx...) will cause the above error
... View more
06-09-2012
12:59 PM
|
0
|
0
|
573
|
|
POST
|
I could do that, but for that matter I could not have the not-null constraints on the fields in the first place since I run the database too. It seems to rather defeat the point of using the database as it should be, to ensure that checks are applied to the data at the point of creation so they are guaranteed to be "valid". Thus preventing some other client from (maliciously or otherwise) sticking loads of random and incomplete stuff in. Surely that is just common sense database design? If on the other hand the attribute inspector could produce a Graphic (perhaps having automatically generated the attribute schema for that graphic from the feature layer) then the client could more easily generate a valid feature before submission. As it is, it seems that the workflow (if we want to use the pre-made editing widgets) is to generate and store in the database an invalid feature, having crippled the database to make this possible, then update the feature in an entirely separate operation after it's created to make it valid. Whilst hoping that nobody comes along and generates invalid features by some other means, or that our client doesn't suffer some kind of error in between making the feature and modifying it. Just seems rather back to front to me - is this really the intention? You can also set up the layerInfos in a way that you can validate the field input. ESRI has a sample: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/ed_attributeInspectorValidate.html
... View more
04-19-2012
05:55 AM
|
0
|
0
|
1402
|
|
POST
|
I have a featurelayer that can be edited when you click on a feature. while editing can the feature attributes that have a domain (displayed using a drop-down) have selected values on them? For example, if the domain is a, b, c, d then based upon certain conditions only a,b are visible or only b,c,d are visible based on certain other conditions while editing the feature? I think you can handle this by controling your symbology with your domain field and conditions (in another field) in you .mxd or .msd, such that certain combination with no symbol (on transparent symbol).
... View more
04-18-2012
10:14 AM
|
0
|
0
|
396
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2011 12:16 PM | |
| 1 | 05-25-2017 08:26 AM | |
| 1 | 06-02-2017 07:37 AM | |
| 1 | 06-28-2011 07:02 AM | |
| 1 | 06-12-2017 10:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-01-2024
09:57 PM
|