|
POST
|
Try something like: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Feature Layer Only Map</title> <link rel="stylesheet" href="http://js.arcgis.com/3.13/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } </style> <script src="http://js.arcgis.com/3.13/"></script> <script> require([ "dojo/dom-construct", "esri/map", "esri/layers/FeatureLayer", "esri/geometry/Extent", "esri/InfoTemplate", "dojo/domReady!" ], function( domConstruct, Map, FeatureLayer, Extent, InfoTemplate ) { var bounds = new Extent({ "xmin":-16045622, "ymin":-811556, "xmax":7297718, "ymax":11142818, "spatialReference":{"wkid":102100} }); var map = new Map("map", { extent: bounds, basemap: "streets" }); var bm = map.getLayer("layer0"); bm.setVisibility(false); var url = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/2"; var template = new InfoTemplate("World Regions", "Region: ${REGION}"); var fl = new FeatureLayer(url, { id: "world-regions", infoTemplate: template }); map.addLayer(fl); bm.setVisibility(true); } ); </script> </head> <body> <div id="map"></div> </body> </html>
... View more
05-01-2015
02:23 PM
|
2
|
3
|
969
|
|
POST
|
I second this... Vincent, I use the same method as Ken and started to modularize as my map application expanded, e.g.: var dojoConfig = { packages: [{ "name": "jsModules", "location": location.pathname.replace(/\/[^/]+$/, "") + "/jsModules" }] }; ... require([ "jsModules/myModuleFoo", "jsModules/myModuleBar" ], function ( myModuleFoo, myModuleBar ) { ready(function () { ... Your own modules would contain only the Esri modules that are needed... The dojoConfig at the top allows you to include user modules in your main code file. Not sure if this is helpful, but here's an Esri example that uses "extra" modules: https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html The "extra" module code file in the example is located here: http://developers.arcgis.com/javascript/samples/layers_point_clustering//extras/ClusterLayer.js This isn't a very elegant way of doing things, but, if you keep everything on single lines, you can easily reorder in Excel! Just copy each part as separate columns, sort one column and expand the selection to maintain the association/order, then paste back into your document making sure to fix the mismatched commas.
... View more
05-01-2015
02:07 PM
|
0
|
0
|
1062
|
|
POST
|
Try this: on(dom.byId("btnFeedback"), "click", function (e) { if (document.getElementById("eMail") == null || document.getElementById("eMail").value == "") { alert("not working"); } else { sendEmail(); } }); Hope this helps! I confirmed this is working on my end... The way it sits now, whenever someone clicks on "btnFeedback", it will throw an alert window if the "eMail" element isn't on the page, or, it is, but the value is empty, otherwise, we'll send an e-mail. I made some minor mods, including lowering the case on your initial "If" to "if". I removed the "value" method on your first condition... it shouldn't ever be null, just "". I left the check because if it's not on the page, it will throw the alert. getElementById should always return an object, even if it's not found... it'll be a null object. Additionally, I removed the ";" from your conditional and fixed your mismatched brackets.
... View more
05-01-2015
01:03 PM
|
2
|
2
|
2439
|
|
POST
|
I also tried the candidate one: Find Address Candidates: (GeoCode/AddressLocator_Test2) I pulled a Skagit County addy: 910 Cleveland Avenue, Mount Vernon, 98273 And returned: Shape: Point: X: 1274832.950875386 Y: 520246.64341954107 Score: 95.21 Address: 910 CLEVELAND AVE, MVW, 98273 You'll probably have to add the out fields, I believe...
... View more
04-28-2015
12:17 PM
|
2
|
0
|
2609
|
|
POST
|
I tried this (updated answer): {"records":[{"attributes":{"STREET": "910 Cleveland Avenue","CITY": "Mount Vernon","ZIP":"98273"}}]} And returned: address: 910 CLEVELAND AVE, MVW, 98273 location: {"x":1274832.9507542253,"y":520246.6433484256} score: 95.21 attributes: {"ResultID":-1,"Status":"M","Score":95.21,"Match_addr":"910 CLEVELAND AVE, MVW, 98273","Side":"L","Ref_ID":7234,"Street_ID":"0","User_fld":"03085","Addr_type":"StreetAddress"}
... View more
04-28-2015
12:12 PM
|
0
|
1
|
2609
|
|
POST
|
Here's an example of using a custom template: var serviceUrl = "https://myserviceurl.com/arcgis/rest/services/etc ..."; var outFields = ["OBJECTID", "FIELD1", "FIELD2", "FIELD3"]; var content = "<tr>" + $("#ff_formVal").val() + ": <td>{FIELD3}</td></tr>" var infoTemplate = new esri.InfoTemplate("{FIELD3}", content); var fl = new FeatureLayer(serviceUrl, { id: "featLayer", mode: FeatureLayer.MODE_ONDEMAND, outFields: outFields, infoTemplate: infoTemplate, wkid: 102100 }); I made some code mods after pasting, so hopefully I didn't foobar something (updates not tested)!
... View more
04-28-2015
11:52 AM
|
0
|
0
|
764
|
|
POST
|
Janice, These threads have some info regarding this: arcgis 10.2 - Adding more fields in locator style to creat customized address locator - Geographic Information Systems S… http://support.esri.com/en/knowledgebase/techarticles/detail/39887 Hope this helps!
... View more
04-28-2015
11:37 AM
|
0
|
0
|
2609
|
|
POST
|
I'm not sure if this is helpful, but if you have any need for employment projections, the BLS has some datasets for this, at the national level: Employment Projections Home Page There's also population projections from the Census: Population Projections - Main - People and Households - U.S. Census Bureau
... View more
04-28-2015
11:24 AM
|
0
|
0
|
865
|
|
POST
|
Peter, I've stumbled across some issues with the proxy in the past - if you run into any further issues, have a look at the following, if helpful: Basic Viewer Print Widget in IE
... View more
04-02-2015
07:07 AM
|
0
|
0
|
2860
|
|
POST
|
Just curious - what happens if you always enable the proxy? esriConfig.defaults.io.alwaysUseProxy = true;
... View more
03-31-2015
12:02 PM
|
0
|
1
|
2860
|
|
POST
|
Oops, just realized state plane probably wont work for your area of interest! Maybe UTM will work?
... View more
03-13-2015
02:34 PM
|
0
|
1
|
1601
|
|
POST
|
It's been awhile since I've used feature compare. It may be related to your projection (looks like GCS since the cluster is set in decimal degrees). What happens if you run it again with the dataframe using a projected coordinate system, like state plane for your research area, and set the cluster tolerance in feet?
... View more
03-13-2015
02:29 PM
|
0
|
2
|
1601
|
|
POST
|
That was my initial thought, too, but when I tried adjusting the property in one of Esri's sandboxes (ArcGIS API for JavaScript Sandbox), it didn't appear to do anything. The following thread appears to explain why: Java API Geocoder Autocomplete max results limit
... View more
03-13-2015
01:58 PM
|
0
|
1
|
1793
|
|
POST
|
Update: I found the API reference regarding "suggest" for the geocoder: ArcGIS REST API - Services and Data Types I don't see anything mentioned about configuring the number of autocomplete results... If it's not supported, maybe Esri can add it?
... View more
03-13-2015
07:20 AM
|
0
|
1
|
1793
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-16-2020 01:25 PM | |
| 1 | 03-20-2019 09:07 AM | |
| 2 | 07-31-2015 07:31 AM | |
| 1 | 09-14-2015 12:14 PM | |
| 1 | 05-12-2015 12:04 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-27-2023
02:30 AM
|