|
POST
|
No worries. Thanks for hanging in there though... you were right: I had to do some debugging in Dev Tools, and actually learned a couple new tricks.
... View more
04-10-2019
09:17 AM
|
0
|
0
|
2716
|
|
POST
|
Okay, there was nothing wrong with the original code/syntax in this thread. Thanks to Robert for providing examples in his original post. What's been tripping me up has been using Typescript for my latest web development explorations. I will have to fork this into another thread and seek some help. When I write the following line in Typescript... let params = urlUtils_1.urlToObject(document.location.href); ...it compiles to this in Javascript... let params = urlUtils_1.default.urlToObject(document.location.href); and inserts a "default". Apparently, the browser doesn't care about the "_1" (underscore1). i've read a little about it and it seems to be innocuous. But it never assigns the URL info to params. If i tweak my compiled Javascript and remove the extra "default", it runs fine. In the Dev Tools console, I see: >query.where
<{__accessor__: b}
>query.where
<"LOCNO = '12345'> So I need to learn a little more about compiling Typescript, I guess.
... View more
04-10-2019
09:08 AM
|
0
|
2
|
2716
|
|
POST
|
Forking this from another thread because I ran into Typescript issues... What's been tripping me up has been using Typescript for my latest web development explorations. When I write the following line in Typescript... let params = urlUtils.urlToObject(document.location.href); ...it compiles to this in Javascript... let params = urlUtils_1.default.urlToObject(document.location.href); and inserts a "default". Apparently, the browser doesn't care about the "_1" (underscore1). I've read a little about it and it seems to be innocuous. But it never assigns the URL info to params. If I tweak my compiled Javascript and remove the extra "default", it runs fine. In the Dev Tools console, I see (background for what I was doing are in the above reference thread.) >query.where
<{__accessor__: b}
>query.where
<"LOCNO = '12345'> So how can I get my Typescript to not mess up the Javascript? Something I need to tweak in my tsconfig.json? This is what mine looks like: {
"compilerOptions": {
"module": "amd",
"target": "es6",
"esModuleInterop": true,
"noImplicitAny": true,
"sourceMap": false,
"jsx": "react",
"jsxFactory": "tsx",
//"allowSyntheticDefaultImports": true,
//"maintainModuleNames" : true,
"experimentalDecorators": true,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"./app/*"
],
"exclude": [
"node_modules"
]
}
... View more
04-10-2019
09:02 AM
|
0
|
1
|
1500
|
|
POST
|
Thanks, Dan. I haven't dug too deep into which fonts are "allowed", nor did I create the original maps behind the map services. I'm a little surprised that seemingly common fonts like "Arial something" wouldn't be available. But I'll see what I can learn. Thanks for chiming in.
... View more
04-10-2019
08:23 AM
|
0
|
1
|
7002
|
|
BLOG
|
Whohoo! Noah, that's awesome. Thanks for sharing, somehow I missed the third installment! Keep going.i
... View more
04-10-2019
08:21 AM
|
1
|
0
|
2458
|
|
BLOG
|
Thanks for writing Part 2. But it's been 2 years again. This should be a monthly installment thing. Following the API documentation and samples is great. But what I struggle with most is debugging. Chrome Dev Tools documentation helps. But tailoring some documentation to the ArcGIS JSAPI developer, especially the "accidental developer" type would be a terrific resources. ESRI's got such savvy folks...Please keep going!
... View more
04-10-2019
07:39 AM
|
0
|
0
|
2458
|
|
POST
|
Hey Dan, what solution did you come up with for this? I'm getting the similar and innocuous seeming error: It doesn't seem to "hurt" anything since it falls back to another font. But I figured there is probably a way to override the font spec from the map services (which, as you said is generated in Pro) with some JSAPI for text labels.
... View more
04-09-2019
01:11 PM
|
2
|
3
|
7002
|
|
POST
|
Haha, that's what I was afraid... so back to Dev Tools it is. I hate to say it but every time I think I may be warming up to Javascript, the debugging still has me pulling out way too much hair.
... View more
04-09-2019
09:31 AM
|
0
|
0
|
2716
|
|
POST
|
Great point. Something I didn't consider. But the field is a string. So now I've tried: app?LOC='12345', which the browser turns into ?LOC%2712345%27 app/index.htrml?LOC='12345' app/index.htrml?LOC=12345 It keeps ignoring this without errors. So then I thought: "Hey, when I instantiate the new View, I'm still assigning a center = [x,y]. So I removed that and added a else
{
view.goTo({center :[-90,35]});
} Now what happens is that, given a lack of x,y when view is created, the map zooms to 0,0,off the coast of West Africa. Grrrr... ! I think my whole "view.when" section is not working correctly, and the code block never really runs as expected. I will go ahead an redact it as needed and then add in the thread. Maybe I'm not seeing the forest for the trees.
... View more
04-09-2019
08:21 AM
|
0
|
2
|
2716
|
|
POST
|
Okay, there are some good examples after all but it's still not working for me. I've amalgamated a few (Robert Scheitlin, GISP, Rene Rubalcava) into this one here ... view.when(function(){
let params = urlUtils.default.urlToObject(document.location.href);
if (params.query && params.query.LOCNO) {
let query = new Query.default();
query.where = "LOCNO = '" + params.query.LOCNO + "'";
locLayer.queryExtent(query).then(function (results) {
setTimeout(function () {
view.goTo(results.extent).then(function () {
locLayer.definitionExpression = query.where;
});
}, 2000);
});
}
}); So I would like to create a URL along the lines of "https://mygreatdomain.com/..../index.html?LOCNO=12345". But this isn't working. In fact, it doesn't do anything. No errors. What am I missing?
... View more
04-08-2019
03:31 PM
|
0
|
4
|
2716
|
|
POST
|
Gosh, note to self: try geonet before googling next time... this here thread looks just like what I need. If you have something even better, please holler...
... View more
04-08-2019
01:49 PM
|
0
|
0
|
2716
|
|
POST
|
How can build external links to an ArcGIS Javascript API map by, say including a unique key for a specific feature in a specific layer, so that the map opens up zoomed into said feature? Basically execute some search/find/query functionality when the page loads with parameters for this query coming from the external URL. I'm seeing some examples for the the out-of-the-box WAB apps here. But are there any examples for doing this with JSAPI?
... View more
04-08-2019
01:41 PM
|
0
|
9
|
2875
|
|
POST
|
Thanks, Kelly - now I get it. Either way, I'm glad that by use of Typescript and the jsapi types, I was alerted to this!
... View more
04-04-2019
10:35 AM
|
1
|
1
|
1493
|
|
POST
|
Okay, I'm confused.... it's quite possible that I got it backward though. This is what I was using before and which seemed to work. (Source: https://developers.arcgis.com/labs/javascript/select-a-basemap/ ) . In the main function , create a BasemapToggle widget. Set the view and the secondBasemap property to satellite .
var basemapToggle = new BasemapToggle({ view: view, secondMap: "satellite" }); Interestingly, the text says 'secondBasemap' and the code 'secondmap'. Both wrong? So are you saying they never existed? Anyway, like I said, it's working after I changed it to nextBasemap.
... View more
04-04-2019
10:19 AM
|
0
|
3
|
1493
|
|
POST
|
Just noticed that the BaseMapToggle widget has properties renamed... found this thanks to the helpful error messages when using Typescript. Used to be for 4.10 as follows... let basemapToggle = new BasemapToggle({
view: view,
secondmap: "satellite"
}) Now, it's let basemapToggle = new BasemapToggle({
view: view,
nextBasemap: "satellite"
}) Not a big deal but I didn't see that in the Release Notes. Is there a place to note observations like this that may be missing from documentation?
... View more
04-04-2019
07:39 AM
|
0
|
5
|
1666
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-16-2025 07:32 AM | |
| 1 | 02-09-2024 05:18 PM | |
| 1 | 02-04-2025 09:27 AM | |
| 1 | 03-22-2019 10:55 AM | |
| 1 | 03-05-2020 08:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|