|
POST
|
I am also noticing that the default search return values of 6 doesn't seem to change no matter what value is appled in WAB dev. Any ideas? Do I need to go into the widgets' js and modify at the stem? Am the only one out there noticing this? I've this up for 5 days now and not a single reply or view.
... View more
09-09-2015
10:19 AM
|
0
|
8
|
2905
|
|
POST
|
I should add some more info and a screen shot: I'm using the basic foldable theme, middle layout. Even in the emulator, it appears that the search menu still disappears under the header div: Looking closely at this iPhone 6 emulate, the menu has disappared up and under the header. Again, if anyone knows where in a config, in the widget js or css that I can get at this behavior that would be great- Thanks David
... View more
09-08-2015
01:33 PM
|
0
|
9
|
2905
|
|
POST
|
Hi this may be a better question for the regular WAB forum, but I finally got my beta version out on my web server at: https://ags2.scgov.net/scgs Everything is working well except the sources pick list from the search widget on a Motorola Nexus 6... After an initial selection of one of my search layers, the sources pick list the disappears (i.e renders off -screen above the search widget and under the header div). Is there anywhere in its config or in the css where I can modifiy this behavior? Or can anyone else try the app on thier device and tell me if they are seeing the same behavior? Thanks- David
... View more
09-04-2015
02:04 PM
|
0
|
10
|
5597
|
|
POST
|
Ok we made some real progress here, let me see if I can describe what's going on: function showZones(evt) {
mapMain.infoWindow.clearFeatures();
if (evt.source.name == "Search by PID") {
//console.log(evt);
qPoly = evt.result.feature.geometry;
qPoint = evt.result.extent.getCenter(); //feature
//console.log(qPoint);
var queryParcels = new Query;
queryParcels.geometry = qPoint; //qpoly;
var parQuery = lyrParcels.selectFeatures(queryParcels, FeatureLayer.SELECTION_NEW);
lyrParcels.on("selection-complete", function (result){
var queryNewZones = new Query;
queryNewZones.geometry = qPoly.getExtent();
var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
mapMain.infoWindow.setFeatures([parQuery, newFloodQuery]);
mapMain.infoWindow.show(qPoly);
});
} else if (evt.source.name == "Search by Address") {
//console.log(evt);
qPoint = evt.result.feature.geometry;
var queryParcels = new Query;
queryParcels.geometry = qPoint;
var addQuery = lyrParcels.selectFeatures(queryParcels, FeatureLayer.SELECTION_NEW);
console.log(addQuery);
lyrParcels.on("selection-complete", function (result){
qPoly = result.features[0].geometry;
var queryNewZones = new Query;
queryNewZones.geometry = qPoly;
var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
mapMain.infoWindow.setFeatures([addQuery, newFloodQuery]);
mapMain.infoWindow.show(qPoly);
});
} else {
console.log("In else");
}
} So after the search's on select result event fires fires showZones, it's event is passed into the function, the info window is cleared and then different geometry's are set depeding on the source. Regardless of the source, we need both the feature layers' result geometry and the results's geometry center. When the source is a feature layer (parcel) we get the center because since the search is already returning the poly geometry we have to reset that geometry it's center in order to handle coincident parcels so they won't be returned in the results. We then take the feature layers' geometry to pass into the on select-complete event newly added in the first if block, where that geometry then performs the second spatial query on whatever you want to intersect. We don't need to show the qPoint event in the select-complete function because the search widget already has it. That solved our problem. Everything worked fine by entering address after address or feature layer attribute after feature layer attribute, but not when we changed sources becasue we did not have anything to specifically handle the result from a feature-layer selection. We knew we had to have a listener to handle the point select event from an address search result because we had to turn that initial point into it's intersecting poly geometry. The last change we made was to the event's source. Instead of using the Search's activeSource.name property, Michael Stranovsky set it to the events source name because if a user didn't specifically pick a source, searche's activeSource.name returned null and thus nothing worked. Thanks Thejus for event idea, that's what got us thinking. If we run into any more bugs or unexpected behavior I'll be sure to post back. Lastly, I myself had been working on this problem (that is - migrating our geocoder select functions to the search) off and on since the widget was released. But it was Michael Stranovsky that came up with the handlers. If I can get this up in a fiddle, I will but moving forward I'd like to turn this into a module and then finally maybe as an extension to the search widget itself for WAB. David
... View more
09-04-2015
09:21 AM
|
1
|
0
|
2082
|
|
POST
|
Thejus- Actually the qPoint is correct. I mistakenly commented out this line: //qPoint = evt.result.extent.getCenter(); //feature where we are setting the geometry to get the center of the extent of the parcel poly feature because when use the geometry of the poly we were also getting coincident neighboring parcels returned in our selection. We could set up and use something other than the default intersect method later.
... View more
09-04-2015
08:04 AM
|
0
|
0
|
2082
|
|
POST
|
ok thanks again Thejus -- something came up I'll get back on this tomorrow and post up what we find...
... View more
09-03-2015
01:47 PM
|
0
|
0
|
2082
|
|
POST
|
I think you're right, let me run a test on that and get back to you
... View more
09-03-2015
01:19 PM
|
0
|
1
|
2082
|
|
POST
|
So for the past 2 years or so we've been using our local point locator in the geocoder widget as a way to fire a query function that returns geometry and atttibute results from the task. For example, when using a geocoder we tell the on select event to to fire a 'showLocation' function that takes the sr and geometry from the geocoded point, creates and sets a graphic point to the event, adds it to the map. We then assign that geometry to a query that performs a select with whatever feature layer or layers we choose then pass the query results into the maps' infowindow (we use a modified side-panel popup instead of the defualt): var locatorUrl = "https://ags2.scgov.net/arcgis/rest/services/WebPointLocator/GeocodeServer";
var scgGeocoder = [{
url: locatorUrl,
name: "WebPointLocator",
singleLneFieldName: "Single Line Input",
placeholder: "Find an Address"
}];
var geocoder = new Geocoder({
map : mapMain,
autoComplete : true,
autoNavigate : false,
arcgisGeocoder : false,
geocoders : scgGeocoder
}, dom.byId("divSearch"));
function showLocation(event) {
mapMain.graphics.clear();
qPoint = event.result.feature.geometry;
var ptSymbol = new SimpleMarkerSymbol().setStyle(
SimpleMarkerSymbol.STYLE_SQUARE).setColor(
new Color([255,0,0,0.5])
);
var graphicPoint = new Graphic(qPoint, ptSymbol);
mapMain.graphics.add(graphicPoint);
var queryParcels = new Query;
queryParcels.geometry = qPoint;
var parQuery = lyrParcels.selectFeatures(queryParcels,FeatureLayer.SELECTION_NEW); //is a deferred
mapMain.infoWindow.setFeatures([parQuery]); //comment out if passing query result to next function
mapMain.infoWindow.show(qPoint); //comment out if passing query result to next function
//center
if (qPoint !== undefined) {
mapMain.centerAndZoom(qPoint, 13); //7 for sph
mapMain.graphics.redraw();
}
lyrParcels.on("selection-complete", showZones);
} Suppose we want to return not only the parcels geometery and attributes, but also the geometry and atributes from whatever layers that parcel intersects. We simply comment out the infowindow and add an on selection-complete event for our parcels layer and pass the reuslts into a second query function that uses the extent of the selected poly. In this case we are using the parcel extent to return whatever floodzone(s) intersect: function showZones(results) {
qPoly = results.features[0].geometry;
// results of first layer returned by point intersect query above
console.log(qPoly);
var queryNewZones = new Query;
queryNewZones.geometry = qPoly.getExtent();
//.getCenter(); if returning a grid poly
var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
var queryNewFirm = new Query;
queryNewFirm.geometry = qPoly.getExtent();
//evt.result.feature.geometry;
var newFirmQuery = lyrNewFirm.selectFeatures(queryNewFirm, FeatureLayer.SELECTION_NEW);
//deferred evacQuery
mapMain.infoWindow.setFeatures([parQuery, newFloodQuery, newFirmQuery]); //parQuery
mapMain.infoWindow.show(qPoint);
//show the parcel
mapMain.infoWindow.show(qPoly);
//show the zones - complete the loop
lyrNewZones.on("selection-complete", returnNull);
}
function returnNull() {
var retVal = null;
} Pretty straightfoward (now - not initally!). Here is a fully working app if you want to see it: https://ags2.scgov.net/SarcoFlood/ you can use 1660 Ringling Blvd as the address. Here is our problem: We want to update this workflow to take advantage of the new search widget so that users can search not only by address but say also by a PID. Of course the search has different on events, but the main problem is that when using the feature layer source as the searchs' activeSource, the result from the first query is not cleared from our info window even though the first query's geometry and attributes are removed. Console logs do show that a new parcel has been selected. The problem does not occur when the activeSource comes from our locator. This is what @michael Stranovsky and I have come up with so far: /*Search */
var s = new Search({
enableButtonMode: true, //this enables the search widget to display as a single button
enableLabel: false,
enableInfoWindow: true,
showInfoWindowOnSelect: true,
map: mapMain,
sources: []
}, "divSearch");
var sources = s.get("sources");
sources.push({
locator: new Locator("https://ags2.scgov.net/arcgis/rest/services/WebPointLocator/GeocodeServer"),
singleLineFieldName: "Single Line Input",
name: "Search by Address",
localSearchOptions: {
minScale: 300000,
distance: 10
},
placeholder: "Search by Address",
maxResults: 3,
maxSuggestions: 8,
enableSuggestions: true,
minCharacters: 0,
});
sources.push({
featureLayer: lyrParcels,
searchFields: ["ACCOUNT"],
displayField: "ACCOUNT",
exactMatch: false,
outFields: ["ACCOUNT", "Shape_Area"],
name: "Search by PID",
placeholder: "ex: 2027070041",
maxResults: 6,
maxSuggestions: 6,
//Create an InfoTemplate and include three fields
infoTemplate: plyParcels, //defined previously
enableSuggestions: false,
minCharacters: 0
});
//Set the sources above to the search widget
s.set("sources", sources);
s.startup();
console.log(sources);
s.on("select-result", showZones); In this case we use the searches' on select-result event to pass in the gemoetry but things get really complicated because we first havet to account for the activeSource - whether from a locator or a featureLayer - and the fact that the search widget is (1) already creating a point graphic if a locator source and (2) that the search is already performing a find and query tasks (I think). Here, when the source is our parcel feature layer, we are essentially performing the query twice as the search is already performing it once. When we tried setting the evt geometry to the extent of the return itself, the querys' default intersects method returned several parcels, so we set the return to get the center of the extent, and then perform both the parcel and intersecting layer query and display the results: function showZones(evt) {
//lyrParcels.clearSelection();
mapMain.infoWindow.clearFeatures();
//mapMain.infoWindow.setFeatures([]);
//qPoint = null;
//qPoly = null;
//lyrParcels.clearSelection();
if (s.activeSource.name == "Search by PID") {
//console.log(evt);
qPoly = evt.result.feature.geometry;
///qPoint = evt.result.extent.getCenter();
//console.log("qPoint Parcel: ");
//console.log(qPoint);
var queryParcels = new Query;
queryParcels.geometry = qPoint;
var parQuery = lyrParcels.selectFeatures(queryParcels, FeatureLayer.SELECTION_NEW);
console.log(parQuery);
var queryNewZones = new Query;
queryNewZones.geometry = qPoly.getExtent();
var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
mapMain.infoWindow.setFeatures([parQuery, newFloodQuery]);
mapMain.infoWindow.show(qPoly);
//console.log(lyrParcels.getSelectedFeatures());
//console.log(results);
} else if (s.activeSource.name == "Search by Address") {
//console.log(evt);
qPoint = evt.result.feature.geometry;
//console.log("qPoint Address: ");
//console.log(qPoint);
var queryParcels = new Query;
queryParcels.geometry = qPoint;
var addQuery = lyrParcels.selectFeatures(queryParcels, FeatureLayer.SELECTION_NEW);
console.log(addQuery);
/*parQuery.then(function(features){
console.log("select features result: ", features);
qPoly = features[0].geometry;
console.log(qPoly);
});*/
//var qPoly = lyrParcels.on("selection-complete", getParcelExtent);
//console.log(qPoly):
lyrParcels.on("selection-complete", function (result){
qPoly = result.features[0].geometry;
var queryNewZones = new Query;
queryNewZones.geometry = qPoly;
var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
mapMain.infoWindow.setFeatures([addQuery, newFloodQuery]);
mapMain.infoWindow.show(qPoly); //previous addQuery
});
//var queryNewZones = new Query;
//queryNewZones.geometry = pPoly
//var newFloodQuery = lyrNewZones.selectFeatures(queryNewZones, FeatureLayer.SELECTION_NEW);
//var addQ = [parQuery, newFloodQuery];
//console.log(lyrParcels.getSelectedFeatures());
//mapMain.infoWindow.setFeatures([parQuery, newFloodQuery]);
//newFloodQuery
//mapMain.infoWindow.show(qPoint);
} else {
console.log("In else");
}
} Again, the result from the first query is not cleared from our info window dispaly even though the first query's geometry and attributes are removed. Console logs do show that a new parcel has been selected. The first-result of the parcel query and does clear from the infoWindow display when we enter an address and then enter a subsequent address. The first-result does This post is related to: How can I use a variable that is set in a function on an on event outside of the event? posted by @michael Stranovsky just the other day in that he is trying to figure out if it is a scope issue that is preventing the infoWindow from clearing the displayed result- Thanks- David
... View more
09-03-2015
10:34 AM
|
1
|
6
|
4668
|
|
DOC
|
Robert - In testing with another layer containing subtypes 1-n (ie no 0 value) I am finding that the results panel and popup both display coded value descriptions. However, the subtype value is displayed as it's integer value and not its description in both panel and popup... David
... View more
09-02-2015
08:07 AM
|
0
|
0
|
9070
|
|
DOC
|
Robert: yes I believe so. Version 1.2.0.1 dated 8/24/15. Yes, the widget results and widget popup do not display the descriptions, just the code. For this particular layer, the subtypes do begin at 0 - could that be causing an isssue? Here is the rest endpoint if you have time to take a look . . . Layer: ScrubJ ay Habitat (ID: 3) David
... View more
09-02-2015
07:14 AM
|
0
|
0
|
9070
|
|
DOC
|
Hi Robert- Is anyone reporting any issues with the display of coded value domain descriptions as returned in the eSearch when the search layer url is pulling from an endpoint that contains subtypes? I have a simple habitat-type layer that returns codes only in both the results dgid and popup. Is there any other configuration steps I can take to enable attribute values to display the domain descriptions when the seach layer has subtypes? Thanks- David
... View more
09-01-2015
03:26 PM
|
0
|
0
|
9070
|
|
POST
|
No sorry I haven't looked at anything mobile project center wise in many months. We do have a mothballed project, but this group wants to wait for collector for windows. What I found works best is when you are downloading a project from the client mobile app is to make sure the download settings (when connecting to and downloading a project from the mobile content server) match the upload settings used when the project was uploaded to your mobile content server from your desktops' mobile project center. I am able to download and sync edits back to my mobile content server after I provide my ArcServer login and password via the download settings in in the mobile app. Hope this helps- David
... View more
08-31-2015
03:17 PM
|
0
|
0
|
4253
|
|
DOC
|
Hi Robert- In the current build, are others experiencing any issues with related records not displaying in the Attribute Table after clicking show related either in the popup or from the attribute table results? Thanks- David
... View more
08-25-2015
09:53 AM
|
0
|
0
|
9070
|
|
POST
|
I should add that I have never and would never try a reorder unless the database is compressed so as to eliminate any impact to states tables
... View more
08-22-2015
12:08 PM
|
0
|
0
|
6584
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-01-2026 05:41 AM | |
| 1 | 06-26-2026 12:39 PM | |
| 6 | 06-25-2026 07:23 AM | |
| 1 | 06-17-2026 06:04 AM | |
| 1 | 06-08-2026 08:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|