POST
|
Robert, I see that your example directly adds the graphics to the mapview and skips instantiating the GraphicsLayer object ... i'll try that and see how it goes... thanks Derek
... View more
02-21-2018
01:52 PM
|
0
|
0
|
1062
|
POST
|
btw... i see that there is a .goTo() method that takes an array of graphics... i've tried mapview.goTo(mygraphiclayer.graphics) ... doesn't work ... do i have to set other options? are there any examples of using the goTo() method with an array of graphics?
... View more
02-20-2018
04:40 PM
|
2
|
2
|
1062
|
POST
|
I am trying to get the extent of my GraphicsLayer which contains a Point and a Polygon so I can zoom into on the map. I don't see any mention of graphicsUtils in the 4.6 API ... then I came across this migration matrix... Functionality matrix | ArcGIS API for JavaScript 4.6 So when is graphicsUtils coming again? or is there another way to get the extent of all the graphics in a GraphicLayer?
... View more
02-20-2018
04:28 PM
|
1
|
3
|
1752
|
POST
|
so my issue was the javascript address object... instead of this: locator.addressToLocations(address) It should be this: locator.addressToLocations({ address: address})
... View more
02-09-2017
02:13 PM
|
2
|
0
|
249
|
POST
|
Hello, I have a custom in-house Locator that accepts: Address Fields: Street ( type: esriFieldTypeString , alias: Street or Intersection , required: true , length: 60 ) Zone ( type: esriFieldTypeString , alias: Zone , required: false , length: 20 ) everything works fine in version 3.19 However, I keep getting an error in 4.2 err.details: [Missing value for a required locator field 'Street or Intersection'.] err.stack: Error: Unable to complete operation. at Anonymous function (https://js.arcgis.com/4.2/:431:265) at f (https://js.arcgis.com/4.2/:117:491) at l (https://js.arcgis.com/4.2/:117:423) at resolve (https://js.arcgis.com/4.2/:120:86) at a (https://js.arcgis.com/4.2/:118:412) at f (https://js.arcgis.com/4.2/:118:169) at l (https://js.arcgis.com/4.2/:117:423) at resolve (https://js.arcgis.com/4.2/:120:86) at a (https://js.arcgis.com/4.2/:118:412) at f (https://js.arcgis.com/4.2/:118:136) here's the code that i'm using... following the 4.2 API var address = { Street: '200 N Spring St', Zone: '90012' }; var locator = new Locator(); locator.url = '//myserver:6080/arcgis/rest/services/Locator/2011_Locator/GeocodeServer'; locator.addressToLocations(address) .then(showAddressCandidates) .otherwise(rejectedPromise); any help or insight into why this is happening would be greatly appreciated... its driving me nuts!
... View more
02-08-2017
10:21 AM
|
0
|
1
|
1063
|
POST
|
hmmm ... i totally didn't think about the geometryservice at all!!!! thanks for the suggestion!!! edit: i forgot... the reason why i was thinking of using an ArcGIS Server GP service was that... I'm looking to create a REST Endpoint that returns the distance of a point from a polygon. I'll look into Node.js and see if I can use that to create a JSAPI service which I can call from another JS Client....
... View more
11-14-2016
02:28 PM
|
0
|
0
|
296
|
POST
|
What is the best way to create an ArcGIS Server Geoprocessing Service that accepts an address (such as a json object or text from the JSAPI) to geocode a point, then... find the distance to a polygon and have that service return the distance ? I've been reading up on creating a model in model builder and then use that result to publish to ArcGIS Server. Would that be the correct way of achieving this? If so, are there any examples of creating a model that utilizes the "Geocode Address" tool to accept an address/zone text string instead of an input table. Any help would be very much appreciated. Thanks, Derek
... View more
11-14-2016
01:00 PM
|
0
|
2
|
726
|
POST
|
Akshay, The reason why i'm using the World Geocoder for the search widget is because our streets dataset and locator is not as up to date as the one from ESRI, Google, etc. And I am modifying our current app to geocode a candidate address and then do some geoprocessing to verify whether the address falls within a particular boundary.... thus the need for the correct offset of either the left or right side of the street ... since most boundary lines run thru a street segment. I can use our in-house locator which has the offset option set in the locator settings as the source for the search widget. But like I said, the streets dataset is a couple years old. Thanks for your help, Derek
... View more
07-07-2015
04:32 PM
|
0
|
0
|
562
|
POST
|
ok I guess my only option is to pass the address & zip to google maps and get the returned json then parse the json for the lat/lon ... create a Point from that and place on the map
... View more
07-07-2015
12:50 PM
|
0
|
0
|
562
|
POST
|
Hi Akshay, Thank you for your response. I will test it out and will let you know the results. Edit: So you are saying that with AutoNavigate set to true (which I assume will zoom to the result) and that adding 10000 to both the x and y coordinates of the resulting geometry ... will help me determine which side of the street the result is truly on? I'm asking is because I need to verify if an address falls within a said polygon whereas its boundaries are drawn right down the middle of a street segment. Edit again... lol... i missed what you said in the beginning of your reply. I will look to other options and if I find a solution, I will post it here. Regards, Derek
... View more
07-07-2015
12:31 PM
|
0
|
3
|
562
|
POST
|
Hello, Is there a way to have the returned result point be offset to be either on the right or left side of the street? I would use a custom locator from our ArcGIS Server's locator but its not as up to date as the world geocoder provided as default in the search widget. Here's the snippet of code i'm using: search = new esri.dijit.Search({
enableButtonMode: false,
enableLabel: false,
enableInfoWindow: false,
autoComplete: true,
map: map,
sources:
[
{
locator: new Locator("//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),
singleLineFieldName: "SingleLine",
outFields: ["Addr_type"],
name: "world_geocoder",
localSearchOptions: {
minScale: 300000,
distance: 50000
},
placeholder: "Search Place or Address",
highlightSymbol: new esri.symbol.PictureMarkerSymbol("images/pins/red-pin.png", 17, 32).setOffset(18, 27)
}
]
}, "searchAddress");
search.startup();
as you can see, the offset is set on the picturemarkersymbol and was taken from an example in the arcgis javascript api documentation. however, its incorrect as the offset will always be at a fixed point... i need the correct offset set by the locator. any insight would be appreciated.
... View more
07-02-2015
08:30 AM
|
0
|
6
|
3635
|
POST
|
I copied the code I posted above (thought i missed a line or something) but it runs fine in both IE 11 and Chrome. What debugger are you using?
... View more
11-17-2014
10:03 AM
|
0
|
1
|
1876
|
POST
|
Hi Chris, try this... I left an alert in the function to see if it fires when you click the clear map button... this should work for you... <!DOCTYPE html> <html> <head> <title>Decatur GIS Template</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1,maximum-scale=1, user-scalable=no"> <link rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css"> <style> html, body, #mapDiv { padding:0; margin:0; height:100%; } #HomeButton { position: absolute; top: 95px; left: 20px; z-index: 50; } #LocateButton { position: absolute; top: 140px; left: 20px; z-index: 50; } #clearGraphicsBtn { height:20px; width:20px; position:absolute; top:200px; left:20px; z-index:50; padding:5px 6px 5px 6px; background-color:Gray; border-radius:5px; } </style> <script src="http://js.arcgis.com/3.11/"></script> <script> var map; require(["esri/map", "esri/config", "esri/dijit/HomeButton", "esri/dijit/LocateButton", "esri/layers/ArcGISTiledMapServiceLayer", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/tasks/GeometryService", "dojo/dom", "dojo/on", "dojo/parser", "esri/geometry/Extent", "dojo/domReady!"], function (Map, esriConfig, HomeButton, LocateButton, ArgGISTiledMapServiceLayer, ArcGISDynamicMapServiceLayer, GeometryService, dom, on, parser, Extent ) { // set custom extent var initialExtent = new Extent({ "xmin": 777229.03, "ymin": 1133467.92, "xmax": 848340.14, "ymax": 1185634.58, "spatialReference": { "wkid": 3435} }); map = new Map("mapDiv", { showAttribution: false, sliderStyle: "small", extent: initialExtent }); // add imagery var tiled = new ArgGISTiledMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Aerial_2014_Tiled/MapServer"); map.addLayer(tiled); // add operational layer var operationalLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Public/InternetVector/MapServer", { "opacity": 0.5 }); map.addLayer(operationalLayer); // declare geometry service esriConfig.defaults.geometryService = new GeometryService("http://maps.decaturil.gov/arcgis/rest/services/Utilities/Geometry/GeometryServer"); // add home button to get full extent var home = new HomeButton({ map: map }, "HomeButton"); home.startup(); // add geolocate button to find the location of the current user geoLocate = new LocateButton({ map: map, highlightLocation: true }, "LocateButton"); geoLocate.startup(); } ); // Clear all graphics from map function clearGraphics() { alert('clear map'); map.graphics.clear(); } </script> </head> <body class="soria"> <div id="mapDiv"> <div id="HomeButton"></div> <div id="LocateButton"></div> <div id="ClearGraphicsButton"> <input type="image" id="clearGraphicsBtn" src="images/nav_decline.png" onclick="clearGraphics()" alt="Clear Graphics" title="Clear Graphics" /> </div> </div> </body> </html>
... View more
11-17-2014
09:47 AM
|
0
|
3
|
1876
|
POST
|
Robert, Have you looked into something like JsonSQL ? or try linq.js - LINQ for JavaScript - Home
... View more
11-03-2014
11:57 AM
|
2
|
0
|
614
|
POST
|
i have a javascript function inside the dojo.requires function: for instance: require(["esri/map"], function(Map) { function switchService(servicename) { alert("hello world"); } function listServices() { var html = ""; var results = // list of services returned from json file //loops thru list for (var i=0; i<results.length-1; i++) { html += '<input checked name="radioService" id="chk_' + serviceName + '" style="margin-left: 15px;" type="radio" value="' + serviceName + "|" + results + '" onclick="switchServices(this.value);" />'; } document.getElementById('divMapServices').innerHTML = html; } } everything works great once i move the switchService function outside of the dojo requires function. However after switching services, i am rebuilding the layers list for the new service and which is located back inside the requires function. thus i cannot accees the buildlayers function since my scope is now outside the requires function... hope that makes sense... lol i've been reading up on dojo and modules... so i might rewrite everything to go that route... however, if anyone has a solution, please let me know
... View more
08-26-2014
10:28 AM
|
0
|
0
|
2559
|
Title | Kudos | Posted |
---|---|---|
1 | 02-20-2018 04:28 PM | |
2 | 02-20-2018 04:40 PM | |
1 | 08-02-2011 10:54 AM | |
2 | 02-09-2017 02:13 PM | |
2 | 11-03-2014 11:57 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|