Just came accross this error and I am quite confused. All I am doing is using the FindTask to find features. This works fine with some values but don't with some other values even though those values exist. instead, it throws me the above error. here is the code:
var initAssetSearch = function () { query(".txt-asset-finder").connect("onkeydown", function (evt) { switch (evt.keyCode) { case dojo.keys.ENTER: var searchKey = $(".txt-asset-finder").val().trim(); console.log("is value infinite: ", isFinite(searchKey)); if (searchKey.length > 3) { // [0] Perform the search $(".asset-search-loader").show(); var assetLayer = new appLayers(); var findAssetParams = { dynamicLayerURL: assetLayer.PACKAGE_LAYERS.UTILITY, layersIdsArray: [1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27], searchFieldsArray: ["MAPREF", "Mapref", "MAINID", "Node_ID", "NODE_ID", "Map_Ref", "Main_ID"], searchText: searchKey }; when(findAsset.findDataTask(findAssetParams.dynamicLayerURL, findAssetParams.layersIdsArray, findAssetParams.searchFieldsArray, findAssetParams.searchText, true), assetSearchResult_CallBack); } else alert("please enter more than 3 characters"); break; case dojo.keys.BACKSPACE: $(".assets-finder-results").html(""); map.graphics.clear(); break; } }); }
the confusion is that this works with some values. example when I search for "A41483", I'll get the result but for "1E1105", I get the above error. I know for sure this value exists.
Is it interpreting such values as "1E1105" as a number written in scientific notation? If so, it would think the value is the number 10^1105.
I think you're right Ken, I tried most values starting with 1E and I get the non-finite error. how do I work around this?
I also tried to parse the value to string but not success!
I'm not sure there is a way to prevent Javascript from interpreting a string that contains a bunch of number with a single "E" in the middle of them as a number. Even something like "201E2" is interpreted as a number. Can you strip away the numbers before or after the "E" and search on that (search for "E1105")?