|
POST
|
Right so you are close. The popup doesn't know where to position itself in the view. Your popup needs to have it's location set at your pt var. Here's how we return the popup from the search: app.search.on("search-complete", function(evt){
console.log(app.mapView.popup);
if (app.activeView.popup.dockEnabled) {
app.mapView.popup.visible = true;
} else {
//set the popup location
app.mapView.popup.location = evt.results[0].results[0].feature.geometry.centroid;
app.mapView.popup.visible = true;}
}); in your case I think you just need to set your popup.location = pt;
... View more
01-19-2017
11:26 AM
|
1
|
4
|
5925
|
|
POST
|
Hi Chris - that's interesing, I wasn't aware of the clone method per say. I also ran into that exact behavior and solved it this way:
//let's get a popup graphic on click:'
app.mapView.on("click", function(evt) {
var screenPoint = {
x: evt.x,
y: evt.y
};
app.mapView.hitTest(screenPoint)
.then(getGraphics);
});
function getGraphics(response) {
app.mapView.graphics.removeAll();
var graphic = new Graphic({
//gotta set a defined geometry for the symbol to draw
geometry: response.results[0].graphic.geometry,
symbol: new SimpleFillSymbol({
color: [255,255,0,0.0],
style: "solid",
outline: {
color: [102,0,204],
width: 5
}
})
});
app.mapView.graphics.add(graphic);
console.log(graphic);
} We've also set up a watch on the popup visiblity to clear graphics and selected results from from the search return: app.mapView.popup.watch("visible", function(visible) { //watch for the vis on the popup to handle the close action,
//if popup not visible AND we have a selected resutlt, clear the search, the popup content and remove the graphics.
if (visible == false) {
if (app.search.selectedResult){
console.log("selectedResult");
app.search.clear();
}
app.activeView.popup.clear();
app.mapView.graphics.removeAll();
}
}); I'm going to try the clone method though that looks cool.
... View more
01-19-2017
08:09 AM
|
0
|
0
|
5831
|
|
DOC
|
Hi Robert, that sounds promising thanks. We've recently adopted alot of attach relates as well and this will certainly be helpful . . .
... View more
01-19-2017
07:44 AM
|
0
|
0
|
13798
|
|
POST
|
Ok so when you say the popup template doesn't work - does the popup display at all? Or does the popup display but with no attributes? Also not to be a pain but if you could use the javascript syntax highlighter for your code that would help - it's hard to read otherwise
... View more
01-18-2017
07:55 AM
|
0
|
6
|
5925
|
|
POST
|
Hi Chuck - are you able to sucessfully render the feature layer from the Graphic array and are the attribute values from the graphic showing as values in the fields array of your feature layer? My guess is that the popupTemplate for the feature layer isn't getting values or the popup doesn't have a location set - it doesn't know where to position itself in the view. I know that you don't need to set the popupTemplate on the graphic, just on the feature layer. Also, you may want to move the station funciton and stations.push under your require I'd check this sample out if you haven't already Create a FeatureLayer with client side graphics | ArcGIS API for JavaScript 4.2
... View more
01-12-2017
10:41 AM
|
2
|
8
|
5925
|
|
POST
|
Also at 10.5 Mobile Data Access is no longer an option for ArcEnterprise. 10.5 Desktop will still support the Create Mobile Cache and Sync Mobile Cache gp tools provided you have previously installed mobile 10.2.1 update utility tools at Desktop 10.4x as ArcServer10.4x supports Mobile Data Access
... View more
01-12-2017
08:31 AM
|
0
|
1
|
2908
|
|
POST
|
Hello all, a followup to original question. We were able to dust off an old function and apply it to 4.x popup content fields: //set field coded value and field name parameters to store and pass the field name and domains'coded values: getDomainValue = function (fieldVal, fieldName){
//get the popup's currently selected feature
var featureLayer = app.activeView.popup.selectedFeature.layer;
array.forEach(featureLayer.fields, function (ldf) { //once in the layer pass the fields into an array
if (ldf.name==fieldName){ //for each field, if the field name property is equavalent to the fieldName param AND if the field is domained, set up a second array to store the coded values:
if (ldf.domain){
array.forEach(ldf.domain.codedValues,function(domain){// once in the domain array, get the coded value and swap in the name instead:
if (fieldVal==domain.code){
fieldVal=domain.name;
}
});
}
}
});//finally return the fieldVal
return fieldVal;
};
//set this function on your domained fields in the popup template As you can see, I've added some simple comments to desribe how I think it's actaully working. Hopfully this will help until the 4.x popup template is updated to read in domain names. Also, at the moment this only works on the view's popup, not the search widget popup beacuse of how I'm setting up the feature layer var, I've still got to modify for the search's selectedFeature layer. David
... View more
01-06-2017
08:40 AM
|
0
|
0
|
3674
|
|
POST
|
Sure. I don't think what you want is possible, at least with a 3.x feature layer. 4.x is more efficient at rendering feature layer graphics, but you'd be better off looking into the other soluctions already mentioned.
... View more
01-06-2017
08:07 AM
|
0
|
1
|
4172
|
|
POST
|
Leo- Why are you using snapshot mode on your feature layer? Do you have to have all points visible at all times regardless of extent? Do all points have to be visible when panning? We get good results with 1000's of points when using On Demand mode, by disabling draw on pan, and controlling visibility scale. That plus projecting our data in web mercator. I also notice you are using a hosted feature layer, so keep in mind that the hosted service is going to return a max of 1000 records per request, I don't think you can change that. David
... View more
01-05-2017
11:26 AM
|
0
|
3
|
4172
|
|
POST
|
Thanks Randall. I should have mentioned our server level at 10.4.1 . . .
... View more
12-15-2016
02:26 PM
|
0
|
0
|
3821
|
|
POST
|
Hi - I have recently noticed that I cannot select map service folders or single map services via the checkbox while in the Manager statistics page when using Chrome version 54.x and now at version 55.0.2883.87 Basically the checkboxes don't activate. I can't say exactly when this occured, sometime over the last 10 days. I then updated to chrome 55 yesterday, same behavior. I then noticed I hadn't updated the latest manager service pack: Announcement: Errors Encountered in ArcGIS Server and Portal for ArcGIS Web Apps after Certain Browser Updates But after running this sp, still same behavior. ie11 and edge are ok- Thanks, David
... View more
12-14-2016
11:40 AM
|
2
|
22
|
9851
|
|
POST
|
Hmmm, I've never had a problem having both a GlobalID and a GUID in the destination table, but then I'm always using a relationship class....Are you defining a relationship class in an fgdb for your layer-table pair before hosting the data?
... View more
12-08-2016
09:57 AM
|
2
|
0
|
1350
|
|
POST
|
HI Shelby - in your webmap have you made sure the GUID field in both your origin and destination tables is set both to display and be editable?
... View more
12-07-2016
12:22 PM
|
1
|
2
|
1350
|
|
POST
|
Hi Undrai - I notice this functionality is still not available at 4.1, any chance it will be available at 4.2? Thanks- David
... View more
12-05-2016
01:39 PM
|
1
|
0
|
3674
|
|
POST
|
We solved this, sort of, using hitTest property: app.mapView.on("click", function(event) { //hitTest used to create a selection graphic for the popup
app.mapView.hitTest(event.screenPoint).then(function(response) { //screenPoint
var result = response.results[0];
var symbol = new SimpleFillSymbol({
color: [255,255,0,0.0],
style: "solid",
outline: {
color: [102,0,204],
width: 5
}
});
app.mapView.graphics.removeAll();
if (result) {
var selectionGraphic = result.graphic;
selectionGraphic.symbol = symbol;
app.mapView.graphics.add(selectionGraphic);
}
});
}); For the view, set up a result to return and a return symbol from the screenPoint location, then for each new result clear the last and add the selectionGraphic. We also added a watch on the popup's visbile property to handle clearing the grahpic when the popup is closed: app.mapView.popup.watch("visible", function(visible) { //watch for the vis on the popup, if false remove graphics
if (visible == false) {
app.mapView.graphics.removeAll();
}
//console.log("popup visible: ", visible);
}); I suppose you could add an action against the esri-icon-close class that could perfrom the same thing . . . The hitTest works fine in 4.1 EXCEPT when a mouse click selects your feature by that new selection tolerance, producing 'No Features Found' bubble. In this case hitTest won't work because the feature is selected but of course no graphic is generated since there is no feature at the screenPoint mouse click. So if anybody knows how to get at that tolerance property for the poup, that would be great so we can figure out how to set maybe a hitTest screen tolerance- Thanks, David
... View more
12-05-2016
01:35 PM
|
1
|
2
|
5831
|
| 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 |
Tuesday
|