|
POST
|
I decided there was something wrong with my logic or maybe my understanding on what was happening as I stepped through the returned candidates. The way I looked at it, I assumed it would use the first candidate, assuming it matched my criteria of 'score > 80'. Since all the scores seem to be 100 anymore, I eliminated that part of the code. I also realized that I wasn't ending up with the 1st candidate, I was consistently getting the 2nd one. I changed my code to define my candidate as the first one in my filtered array and seems to be doing the trick. Either that, or the service is returning something different today than it was earlier in the week! It could be either or both.
... View more
05-14-2014
01:48 PM
|
0
|
0
|
2557
|
|
POST
|
Have you tried making a stripped down version that just has the map and the layers? You have quite a bit going on here with all your finds and your searches. There's definitely a better way to handle that BTW, but off the top of my head I don't have an example to share. I tried your link with Firebug turned on and it's generating errors. If you have anything wrong in the definition of a layer, it's not going to load. It looks like you're telling featureLayer you have an infoTemplate called infotemplate, but that's not defined. Also an FYI, you have at least one place you have dojo.map. Since you're using AMD style, that should be arrayUtils.map, not dojo.
... View more
05-14-2014
05:32 AM
|
0
|
0
|
1828
|
|
POST
|
I'm stuck with having to have my code work in IE 8, and I've had less problems with map.on syntax vs the on syntax. I really wish we could get off it as our default browser, but for now we're stuck with it. At least now they let users have something besides IE!
... View more
05-13-2014
01:10 PM
|
0
|
0
|
1058
|
|
POST
|
I don't know what the advantage would be for using PopupTemplate vs. InfoTemplate. I thought PopupTemplate was an AGOL thing and I'm not using it here. If you define a popup for your map and then infoTemplates for your featureLayer, that should do the trick. The syntax for the template isn't the same as what you're using, but this is a pretty straight forward way to handle it.
var highlightMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 22,
new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,255,0]), 2),new Color([255,255,0,0.5]));
var highlightFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,
new Color([255,200,0]), 2), new Color([255,255,0,0.50]));
var popup = new Popup({
fillSymbol: highlightFillSymbol,
markerSymbol: highlightMarkerSymbol
}, domConstruct.create("div"));
var map = new Map("mapDiv", {
infoWindow: popup,
basemap: "streets",
center: [-92.593, 38.5],
zoom: 7
});
var infoTemplate = new InfoTemplate();
infoTemplate.setTitle("<b>${FACILITY}</b>");
infoTemplate.setContent( "${ADDRESS}<br/>"
+ "${CITY}, ${STATE}<br/>"
+ "Phone: ${PHONE}"
);
pointLayer = new FeatureLayer(servicePathName+"/arcgis/rest/services/myLayerName/MapServer/0",
{mode: FeatureLayer.MODE_SNAPSHOT,
id: "pointLayer",
outFields: ["FACILITY", "ADDRESS", "CITY" , "STATE" , "PHONE"],
infoTemplate: infoTemplate
});
I like to use popup using symbols styled in yellow because I get a highlight effect when I click on the feature. This will give you the 'stepping through multiples' you're looking for. I think infoWindows, infoTemplates and PopupTemplates are confusing to sort through.
... View more
05-13-2014
01:06 PM
|
0
|
0
|
1828
|
|
POST
|
What's making me nuts on this is the inconsistency in the order of what is getting returned. Sometimes it will find what I think is the top candidate first, and sometimes not. This makes no sense to me. I am searching for Salem, MO and Liberty, MO. I would expect the incorporated towns by these names to come up as the first candidates. Yesterday over multiple tries these incorporated places came up as the 2nd in the list of candidates. Today they are first. I used to think it was me not paying attention, but I've tried multiple times over different days and I can see the order is not consistent. Is the ranking that supposedly determines the order generated on the fly? Using the URL the way you have it is not the same way I've been going about it. I'm using the addressToLocations method on the Locator, which generally returns multiple candidates, not just the one JSON formatted response. Am I likely to get different results?
... View more
05-13-2014
05:43 AM
|
0
|
0
|
2557
|
|
POST
|
Update: I did find that I could specify a search extent as an optional parameter to my locator. I also added a filter to the returned candidates that just took me to my state. This helps. But there is what I would call 'bad data' in the locator, so I'm still getting one candidate that is the right one and one that is junk.
function locate() {
map.graphics.clear();
var address = {
"SingleLine": dom.byId("txtAddress").value
};
locator.outSpatialReference = map.spatialReference;
var options = {
address: address,
outFields: ["*"],
searchExtent: startExtent
};
locator.addressToLocations(options);
}
Then in my results handler, I first filtered to my state, which took me down to just two candidates w/o too many lines of code.
var MOcandidates = arrayUtil.filter(evt.addresses, function(candidate){
return candidate.attributes.Region == "Missouri";
});
I think I need to give feedback to whoever maintains the geocoding service. Or maybe I'm supposed to be using the higher paid subscription in order to get better results?
... View more
05-12-2014
01:39 PM
|
0
|
0
|
2557
|
|
POST
|
I'm not just using it for street level matching. I'm using it for searching for a city as well as ZIP code. I've been successful using ESRI's geocoding for this type of matching in the past. I'm going to look harder at the locator names returned to see if that helps me sort through this.
... View more
05-07-2014
01:51 PM
|
0
|
0
|
2557
|
|
POST
|
I always used to use score as a good place to start as to whether or not I think the match should be considered. Often I got away with taking the first candidate that met a minimum score and that turned out to work pretty well. I'm going to have to scrap that idea, based on my own experience and now your feedback. I put in some comments/feedback into the North American Locator (or whatever was the most prominent 2-3 years ago), complaining then that some of the candidates getting returned had no business ever being there. It seemed like it was better for a while. Now I'm back to seeing places that aren't even a wide spot in the road coming back scored the same as towns. I admit that many of the towns in Missouri are pretty small! But they do have people looking for them compared to literally a cow pasture that I can see with the same name. If I come up with anything clever, I will post it.
... View more
05-07-2014
11:44 AM
|
0
|
0
|
2557
|
|
POST
|
I'm using single address input to the World geocoding service, and I'm having a hard time filtering the candidates to what seems like the most likely. I see there is a field called "region", so I worked out how to reject a candidate that isn't in my state. Then I realized there were some place names that were getting returned more than once. There are both incorporated and unincorporated locations getting returned. Each has as score of 100. One looks like it might have come from an old quad. It's completely in the middle of nowhere and to me it has no business at all even showing up as a match. Then I see there is also a city attribute. Only the incorporated town has a value in the city attribute. Ok, so maybe there is something work with there, but it's turning into a lot of filtering! Before I write a chunk of code to filter for everything I obviously need to account for, has some got something written for processing geocoding results that handles this scenario?
... View more
05-06-2014
12:39 PM
|
0
|
11
|
3763
|
|
POST
|
I think you should be waiting for the queryTask to complete, not the map add layers event. All my examples I have handy are in AMD style, but you should be able to find some examples that are something like
dojo.connect (queryTask, "onComplete", getLocRes);
Then in the line to execute the query, you won't include the results handler, you'll just run queryTask.execute(query);
... View more
05-01-2014
01:09 PM
|
0
|
0
|
1357
|
|
POST
|
Thanks for taking the time to look at this. Some of the threads that describe this issue are using jQuery, so I'm not sure it matters dojo vs jQuery on what its built with. As I look around the threads I see several that describe a 'known bug' with the map not knowing how to size or position itself correctly if it's not on the main screen at the start. This sounds like something that needs to be addressed in the API itself. I can't believe I'm the only person who is designing something for mobile that has a menu selection process before a map is shown. I'm working with state-wide data and it only makes sense to limit the area before I launch the map.
... View more
04-29-2014
01:23 PM
|
0
|
0
|
846
|
|
POST
|
I have an application that starts with a menu where the user selects a county, a category of information and then clicks 'Go' to execute. The execute does a find on a county layer, zooms to that county and switches from the menu view to the map view. The first time I zoom to the county, it is not centered to my div. Or maybe it thinks it is, but it's using a div of 400 x 400, the default, which places it in the upper left of my div. If I switch back to the menu and pick another county, then it is centered and zoomed correctly. I've tried all sorts of settings to get it to be properly centered on the first county pick, but no luck at all. All subsequent selections are always fine. Why is this? Does anyone have any other suggestions? I've combed through the forums trying to include all the tricks that make sense. My map is already defined as autoResize:false and I have listeners to manually resize and reposition. This isn't enough to take care of my problem. Here's my fiddle. http://jsfiddle.net/schlot/6ufxj/
... View more
04-29-2014
08:42 AM
|
0
|
2
|
1441
|
|
POST
|
I have a dojox line chart that's populated from an identifyTask. I'm pushing the results into an array, which is the input for my plot series. I'm having a hard time searching out documentation on this, but I was able to get pretty far along with some trial and error. The chart looks the way I want, except that the markers on the first and last values are cut off and I don't like the way it looks. I'm looking for a parameter I can put on the X axis to prevent this. Or maybe I need a better calculation to define the min and max on the axis so the markers fall a bit farther inside the very edge? My data has multiple years worth of information for each polygon. The layers in the service are named so the last 4 characters are always the year. I'm using an identify on the center of the polygon. This is my results handler
function getStatsHandler(results){//formats the results for line chart, then generates it
stats.length = 0;
yearList.length = 0;
rateList.length = 0;
var year;
domConstruct.empty("chartDiv");
for (i=0;i<results.length;i++) {
var lyrResult = results;
itemLength = lyrResult.layerName.length;
yearPos = itemLength - 4;
year = lyrResult.layerName.substr(yearPos, 4);
var rate = lyrResult.feature.attributes.RATE;
yearList.push({value: i+1, text:year});
rateList.push(parseFloat(rate));
};
rateList.sort(function(a,b){return a-b});
var maxVal = rateList[rateList.length -1];
maxVal = Math.round(maxVal);
var axisMax = (parseInt(maxVal/10)+1)*10;
var lineChart = new Chart2D("chartDiv", {
title: currentCounty + "</br>" + title + " Rates" ,
titlePos:"bottom",
titleGap: 12,
titleFont: "normal normal normal 13pt Arial",
});
lineChart.addPlot("default", {
type: "Lines",
markers: true,
hAxis: "x",
vAxis: "y"});
lineChart.addAxis("x", {
title:"Rates by Year",
titleOrientation:"away",
labels: yearList,
font: "normal normal normal 9pt Arial",
majorLabels: true,
minorTicks: false,
minorLabels: false,
microTicks: false });
lineChart.addAxis("y", {
title:rateNote,
vertical: true,
fixLower: "major",
fixUpper: "major",
min: 0,
max: axisMax,
minorTicks: false,
minorLabels: true});
//{vertical: true, min: 0, max: axisMax});
lineChart.addSeries("Series 1", rateList, {
stroke: { color: "red", width: 2 }
}
);
var tip = Tooltip(lineChart, "default", {
text : function(o) {
var yr = yearList[o.x].text;
var yrList = parseInt(yr) - 1;
return ( yrList +'<br>' + o.y );
}
});
lineChart.render();
}
Everything works in this code except for the cropped markers. Even the online examples for line charts look to have this problem too, but I'm hoping for a workaround anyway.
... View more
04-28-2014
01:44 PM
|
2
|
9
|
7069
|
|
POST
|
I found a suggestion for adding a dropdown arrow. It involved adding a class to the input and then styling it was an arrow shaped background image.
HTML
<input id="countySelect" type="text" class="combo-select" data-dojo-type="dojox/mobile/ComboBox" data-dojo-props="list:'countyList'" placeHolder="Select a county" maxHeight="350" />
CSS
.combo-select {
background-image: url('../images/dropdown_arrow_black.png');
background-repeat: no-repeat;
background-position: right center;
padding-right: 10px;
}
... View more
04-28-2014
10:39 AM
|
0
|
0
|
874
|
|
POST
|
In the end, I added the claro style sheet and that seems to have helped.
<link type="text/css" rel="stylesheet" href="https://js.arcgis.com/3.8/js/dojo/dijit/themes/claro/claro.css">
Our tests using filteringselect on mobile devices has not been good. The only combination for generating a dropdown that works on a phone as been the combination I described in my first posting, dijit/form/DataList and dojox/mobile/ComboBox. I tried using the standard ComboBox dijit/form/ComboBox, but that doesn't look to scroll correctly on a phone. It still doesn't have the dropdown arrow I think it should have. FilteringSelect automatically adds one, but ComboBox does not.
... View more
04-25-2014
07:13 AM
|
0
|
0
|
874
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|