POST
|
nevermind - i see it updated in your codepen sample. Thank you!
... View more
05-21-2021
07:13 AM
|
0
|
0
|
4988
|
POST
|
That sounds good - just explicitly verifying - does that mean we will be able to use our current servers with 4.20 even if they are not yet updated? Also - does 4.next of the api include bug fixes or do i have to wait for the release to try it out?
... View more
05-21-2021
05:40 AM
|
0
|
1
|
4990
|
POST
|
Thank you for looking into this. So you're saying it's both an issue with the version of our server, but also for the REST api?
... View more
05-20-2021
09:58 AM
|
0
|
0
|
4995
|
POST
|
I am exploring the use of lerc and client side handling of pixel data. In the specs I see it as capable, however I'm not sure how to configure my layers to get it to work. One is a classified one like landcover (just doesn't show), the other based on floating point values (gives an infinity error). Is this a bug, our service, or user error on configuring the layer? ArcGIS server 10.41 (should be supported as of 10.3) codepen: https://codepen.io/lizeidsness/pen/gOmLovj
... View more
05-19-2021
07:05 AM
|
0
|
5
|
5060
|
POST
|
I am trying to explore the idea of hosting our own version of the minimalist app, to support adding page surrounds etc, extra features. I have noticed that my developer version of AGOL has the modern updates (ie express setup), but a lot of the documentation around configurable apps is for the old version. Regardless of all this, in the dev AGOL how might I get my self-hosted minimalist template working and configurable? It will open for configuration, but the express selections for a map don't do anything, and also switching to full doesn't have an effect. I have tried pasting various examples into the Configuration Parameters section (old and maybe new?), and nothing seems to make a difference. Clearly I should be pasting something, but I'm not sure what.
... View more
03-20-2021
08:46 AM
|
0
|
0
|
569
|
POST
|
Oh that's great thank you! Sometimes you just need to know what to search for. It seems like that would have been an obvious result of my searching, but it wasn't.
... View more
02-05-2021
06:27 AM
|
0
|
0
|
2788
|
POST
|
I have an application that is requesting a computeStatisticsHistograms from our image service based on a user's feature selection. The features vary in size. I have noticed that I get this error returned for geometries over a certain size. On layers that have higher resolution, that threshold is lower (only tolerates smaller geometries). Clearly from the error, there is a size limit, but I can't find what it relates to. Using ArcGIS Server 10.4 but I also tried on an ArcGIS Online layer at 10.71. error retured: "code": 400,
"message": "Invalid or missing input parameters.",
"details": [
"The requested image exceeds the size limit."
] Has anyone come across this? What can we do to tweak the services to prevent this error from happening? Alternatively, if I knew what the limit was in relation to some math - ie.. no more than N pixels - I could trap it.
... View more
02-03-2021
07:06 AM
|
0
|
2
|
2836
|
POST
|
Thanks! I was having trouble figuring out how they fit together.
... View more
06-16-2020
05:44 AM
|
1
|
1
|
854
|
POST
|
I have seen in the API documentation a reference to SearchResultRenderer class. SearchResultRenderer | ArcGIS API for JavaScript 4.15 In addition, I have seen examples where after a search, popup displays "more results". I'd like to display that "more results" menu separately from a popup. Preferably as a list of results before the user pics one. I have not seen an example where this is done - I'm wondering if anyone has an example I could look at - or if you know how I might leverage that class/something else to create a list in a new location. I know how to do this: searchWidget.on("search-complete", function(event){
// The results are stored in the event Object[]
console.log("Results of the search: ", event);
}); I'm looking for a better way - I'm wondering if SearchResutRenderer might be it or something else.
... View more
06-15-2020
10:46 AM
|
0
|
3
|
921
|
POST
|
I went looking in the LayerList widget's source code for clues, and figured it out. I was using the same name for my trigger function as the method for raising the trigger. So changing _triggerAction to _myTriggerAction resolved the issue. Leaving it here for anyone else.
... View more
10-09-2019
10:39 AM
|
0
|
0
|
599
|
POST
|
Hi, I'm trying to extent the LayerList widget as a means to reuse preferred settings/code between projects. The trouble I'm having is in implementing the trigger-action handler. I have ported the code from the sample. It worked fine outside of my widget extension, so It's likely a matter of scope, but I can't figure out how to change it. I'm writing my widget in TypeScript. In postInitialize, I'm setting up the list item actions, and they seem to work. But on click, the event coming through to _triggerAction doesn't have event.item. I noticed it is of type "click". Might be a clue as to what is going on?? relevant bits: postInitialize() {
var defineActions = this._defineActions.bind(this);
this.listItemCreatedFunction = defineActions;
var triggerAction = this._triggerAction.bind(this)
this.on("trigger-action", triggerAction);
}
private _triggerAction(event) {
var layer = event.item.layer;
var id = event.action.id;
if (layer) {
switch (id) {
case "full-extent":
this.view.goTo(layer.fullExtent);
break;
case "information":
window.open(layer.url);
break;
case "increase-opacity":
if (layer.opacity < 1) {
layer.opacity += 0.25;
}
break;
case "decrease-opacity":
if (layer.opacity > 0) {
layer.opacity -= 0.25;
}
}
}
} I'm using JS API 4.11. Ideas? Liz
... View more
10-09-2019
08:16 AM
|
0
|
1
|
718
|
POST
|
I resolved this one on my own, though ESRI did also provide a solution. Both here. Revised codepen: https://codepen.io/lizeidsness/pen/zgOpBL My problem was the watch wasn't set on the right thing. So there's an initial watch on the activeLayerInfos.length property. If there's a legend it will be > 0. New: If there's a layer in the legend, set a watch on it's legendElements object. If this changes, it will update accordingly. watchUtils.when(legend, "activeLayerInfos.length", setWatch);
function updateLegend(layer) {
var activeLayer = legend.activeLayerInfos.find(e => {
return e.layer.title == layer.title;
});
if (activeLayer.legendElements.length < 1) {
return false;
}
var element = activeLayer.legendElements.find(e => {
return e.type == "symbol-table"; //add additional support
});
element.infos.forEach(e => {
lookup.forEach(item => {
if (e.label == item[0]) {
e.label = item[1];
}
});
});
}
function setWatch() {
if (legend.activeLayerInfos.length > 0) {
legend.activeLayerInfos.forEach(al => {
watchUtils.when(al, "legendElements", function () {
updateLegend(al);
});
});
}
} ESRI's solution would intercept the legend response from the service. It would work well enough, if there isn't an appropriate API property to watch instead (in this case) esriConfig.request.interceptors.push({
urls: imageryLayerUrl + "/legend",
after: function (response) {
response.data.layers[0].legend.forEach(l => {
l.label = "not " + l.label;
});
}
});
... View more
07-23-2019
06:20 AM
|
0
|
0
|
1676
|
POST
|
Glad I could help! It will always be hard to keep things on top of the map without covering something. It's also depends on the browser size, or container if this will be in an iframe. Have fun!
... View more
07-19-2019
06:09 AM
|
0
|
0
|
2384
|
POST
|
It is your lucky day - I needed a break from what I was doing, and I learned some things along the way. If you use this version (combination of the esri sample and your code), you'll notice there's a console.log output of the passport office name on map click. Line 205. You can handle the rest I think. A couple problems with your original. I disabled popups on fLayer. Consolidated the event handling because you have 3 views. Complicated! Also created a click handler! There is a syntax highlighter in "More... " <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>{PROTOTYPE} Passport Agency Map - JavaScript 4.12</title>
<!--reference the JavaScript 4.12-->
<link rel="stylesheet"
href="https://js.arcgis.com/4.12/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.12/"></script>
<style>
html,
body,
#mainviewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
#hiViewDiv {
padding: 0;
margin: 0;
height: 135px;
width: 200px;
background-color: rgba(255, 255, 255, 0.9);
border-style: solid;
}
#prViewDiv {
padding: 0;
margin: 0;
height: 135px;
width: 200px;
background-color: rgba(255, 255, 255, 0.9);
border-style: solid;
}
/*Style for feature hover */
.esri-feature {
letter-spacing: 0em;
line-height: 1.55rem;
font-feature-settings: "liga"1, "calt"0;
background: #fff;
padding: 1em;
}
</style>
<script>
require([
"esri/Map",
"esri/widgets/Home",
"esri/widgets/BasemapToggle",
"esri/layers/FeatureLayer",
"esri/views/MapView",
"esri/widgets/Feature",
"esri/widgets/Track",
"esri/Graphic"
], function (Map, Home, BasemapToggle, FeatureLayer, MapView, Feature, Track, Graphic) {
var fLayer = new FeatureLayer({
portalItem: {
id: "5710089ef1374c6d939ebee954c8b15c" //Portal ID number
},
popupEnabled: false,
outFields: ["*"]
});
var map = new Map({
basemap: "streets-navigation-vector",
layers: [fLayer]
});
//Contiguous USA Main Map
var mainView = new MapView({
container: "mainviewDiv",
map: map,
extent: {
spatialReference: {
latestWkid: 3857,
wkid: 102100
},
xmin: -14513000, //bounding box for the inital load of the application
ymin: 2887000,
xmax: -7390000,
ymax: 6326000
},
constraints: {
minScale: 39911104 //user cannot zoom out past this scale
}
});
// Hawaii inset map
var hiView = new MapView({
container: "hiViewDiv",
map: map,
extent: {
xmin: -17834000,
ymin: 2111000,
xmax: -17173000,
ymax: 2573000,
spatialReference: {
wkid: 102100
}
},
spatialReference: {
wkid: 102100
},
ui: {
components: []
}
});
mainView.ui.add("hiViewDiv", "bottom-left");
// Puerto Rico inset map
var prView = new MapView({
container: "prViewDiv",
map: map,
extent: {
xmin: -7887000,
ymin: 1924000,
xmax: -6957000,
ymax: 2257000,
spatialReference: {
wkid: 102100
}
},
spatialReference: {
wkid: 102100
},
ui: {
components: []
}
});
mainView.ui.add("prViewDiv", "bottom-right");
//adding a home button
var homeBtn = new Home({
view: mainView
}); // end of Home Button
mainView.ui.add(homeBtn, "top-left"); //adding a home button to the top left under the zoom in/out
var toggle = new BasemapToggle({
view: mainView,
nextBasemap: "satellite"
}); //end of BasemapToggle
mainView.ui.add(toggle, "top-left"); //adding basemap toggle to the top right
var graphic = {
popupTemplate: {
content: "Mouse over passport icons to show details..."
}
};
// Provide graphic to a new instance of a Feature widget
var feature = new Feature({
graphic: graphic,
map: mainView.map,
spatialReference: mainView.spatialReference
});
mainView.ui.add(feature, "top-right"); //adding feature hover widget to top right
mainView.when().then(function () {
// Create a default graphic for when the application starts
return fLayer.when();
}).then(function (layer) {
return mainView.whenLayerView(layer);
}).then(setupLayerEvent);
prView
.when()
.then(function () {
return fLayer.when();
})
.then(function (layer) {
return prView.whenLayerView(layer);
})
.then(setupLayerEvent);
hiView
.when()
.then(function () {
return fLayer.when();
})
.then(function (layer) {
return hiView.whenLayerView(layer);
})
.then(setupLayerEvent);
function setupLayerEvent(layerView) {
layerView.view.on("pointer-move", eventHandler);
layerView.view.on("pointer-down", eventHandler);
layerView.view.on("click", clickHandler);
function eventHandler(event) {
layerView.view.hitTest(event).then(getGraphics);
}
function clickHandler(event) {
layerView.view.hitTest(event).then(function (response) {
if (response.results.length) {
const graphic = response.results.filter(function (result) {
return result.graphic.layer === fLayer;
})[0].graphic;
const attributes = graphic.attributes;
console.log(attributes.Name); //continue here.
} else {
}
});
}
let highlight, currentId;
function getGraphics(response) {
if (response.results.length) {
const graphic = response.results.filter(function (result) {
return result.graphic.layer === fLayer;
})[0].graphic;
const attributes = graphic.attributes;
const URL = attributes.Link;
const id = attributes.FID;
if (
highlight && currentId !== id
) {
highlight.remove();
highlight = null;
return;
}
// highlight all features belonging to the same hurricane as the feature
// returned from the hitTest
const query = layerView.layer.createQuery();
query.where = "FID = " + id;
layerView.queryObjectIds(query).then(function (ids) {
highlight = layerView.highlight(ids);
feature.graphic = graphic;
currentId = id;
});
} else {
// remove the highlight if no features are
// returned from the hitTest
highlight.remove();
highlight = null;
}
}
}
}); // end of Main function
</script>
</head>
<body>
<div id="mainviewDiv" class="esri-widget"></div>
<div id="hiViewDiv" class="esri-widget"></div>
<div id="prViewDiv" class="esri-widget"></div>
</body>
</html>
... View more
07-17-2019
12:14 PM
|
0
|
2
|
2384
|
POST
|
There's a couple things going on. Popups need to be disabled on view/layer, or manually handled. Also FeatureLayer doesn't have a click event. This sample might help: https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/index.html In this sample, the view events are handled manually. It has a lot more going on, but hopefully the event flow can help. In codepen, after line 139 - I added window.open("http://google.ca"); and on feature click (not mouse over) it opens a window to google.
... View more
07-17-2019
09:11 AM
|
0
|
1
|
2384
|
Title | Kudos | Posted |
---|---|---|
1 | 06-16-2020 05:44 AM | |
2 | 07-17-2019 07:35 AM |
Online Status |
Offline
|
Date Last Visited |
12-09-2021
04:32 PM
|