|
POST
|
Do you have the snippet of code you are using in setRequestPreCallback ? I think it needs to be set as a query param to the service so the request should look something like this: MapServer?f=json&token={insert token here}&dpi=96&transparent=true&format=png8
... View more
08-28-2015
11:25 AM
|
0
|
0
|
624
|
|
POST
|
I can take a shot at this but someone with some more server side experience may be able to give you a better answer since I spend the majority of my time on the font-end, and hopefully this is what you were asking for. From what I understand, the proxy acts as a middleman that forwards requests on the requesters behalf and hands back the results. This allows your application to make requests to other domains that they normally cannot make due to CORS(Cross origin resource sharing) issues. Proxies can be dangerous if not configured properly but the esri proxies have two helpful ways to make it more secure. First, you have to specify the URL's the proxy is allowed to make requests to, this way the proxy cannot request to any url because it will throw an error saying that the url is not allowed or in the configured server urls. The next thing you can do is in the allowedReferers option in the ProxyConfig tag. This says who can use this proxy, leaving * there means anyone can use the proxy and that can be dangerous, but if you specify the applications domain here then that means only that domain can make requests. If you set both the allowedReferers and serverUrl configurations up, you can limit the scope of what the proxy can access and who can access it. Hope this helps.
... View more
08-28-2015
08:59 AM
|
1
|
1
|
617
|
|
BLOG
|
Yea the executing of the plugins was a gotcha at first for me. It use to throw module not found errors because it could not resolve the dojo plugins. I had some success if the loader plugin was a local module but not if I used the dojo loader plugins. However I don't use plugins in our apps anymore or any of the other extras. I use react to render my views have been playing with different methods for css. Right now I am injecting critical css into the head and then loading our single javascript bundle, then once that is loaded I lazy load the remaining css. This worked and was able to boost my page speed insights score a bit but did require a slightly different setup. We originally chose r.js at first because it was simple and we did not need any extras, but I would love to see a writeup on dojos to see what else it can offer and if there is anything that can simplify our current process.
... View more
08-27-2015
11:40 AM
|
0
|
0
|
272
|
|
BLOG
|
Great article, We have been doing a lot of Flux and React lately and are using tons of open source build tools and the last thing for us to integrate is downloading the API from either the Optimizer or esri-slurp and plugging it into our build system. I think the examples here may be a good step in the right direction for us. Cant wait to see the follow up on creating a custom build with Dojos build system, I am very curious to see how that all works since thats something I have never dug deep into. We are currently using RequireJS optimizer for our builds just because of the simplicity of it.
... View more
08-27-2015
10:54 AM
|
0
|
0
|
272
|
|
POST
|
Another thing you may be able to try is to check the event that gets passed to checkAddress, it has lots of useful properties for things like this. For example: on(document.getElementById('ownerAddress'), 'focusout', checkAddress);
function checkAddress (event) {
console.dir(event);
// event.target or event.srcElement will both point to the node that triggered the event, a.k.a. ownerAddress
// There are also a lot of other properties attached to event that can also be useful
}
In this case you don't have to do anything special to get event into checkAddress, it is automatically passed in for you (unless you use Angular).
... View more
08-14-2015
08:48 AM
|
2
|
2
|
1349
|
|
POST
|
If you are going to use css to hide this logo, keep in mind the class name can change from .logo-med to .logo-sm on smaller screen sizes so you may want to include .logo-sm in your css. In my personal opinion, I think the easiest and best way to do this is hide the logo in the map constructor using logo:false and adding some html inside your map div (by map div I mean the div you are mounting your map into), this way you can absolutely position the new logo and give it a z-index to sit over the map.
... View more
08-12-2015
11:15 AM
|
0
|
0
|
815
|
|
POST
|
Hi Kristian Ekenes, that's pretty much it. What your doing in 4.0 is similar to what I want to be doing in 3.14. We are not using the Basemap Gallery widget and instead have designed our own. Behind the scenes of our basemap gallery we just call map.setBasemap('terrain') when they select terrain for example. What I would like to do is have a way to call map.setBasemap('stamen') and have it work, but I am not sure that is possible. In the past we did what you linked in your first example but were not using the default basemap gallery anymore. I will try playing with the Basemap and BasemapLayer classes later on and see if I can use those to make this work but I have a feeling your right in that map.setBasemap will not work with my own layers unless they are simple map services. On a side note, really looking forward to 4.0 because as you said, this would be much more trivial with that API.
... View more
08-11-2015
02:13 PM
|
0
|
0
|
1024
|
|
POST
|
Thanks, good to know, next time I get some free time to work on that part of the mobile app again Ill have to try to remove our hacks and see how things work.
... View more
08-11-2015
01:25 PM
|
0
|
1
|
1010
|
|
POST
|
We are using 3.14 and have not seen this issue lately but used to all the time. One trick we used was to not only set the autoResize to false, but also to not call map.resize or map.reposition directly in the controller on it's initial load, instead wrap them in a 100ms timeout using angular's timeout service. When we just tried to resize the map at the bottom of the controller we frequently had the same issues that everyone else seems to be having. But when we did it like below at the end of our controller function everything started working. $timeout(function () {
// resize map here if the map is loaded, else, wait til map is loaded then resize
}, 100); I normally don't like using timeouts but it seemed like in an angular app with several pages, occasionally the controller would fire things before the map ever loaded and we would get some strange issues. Our app is a single-page app using Phonegap and Angular.js plus several other libraries.
... View more
08-11-2015
12:33 PM
|
0
|
5
|
1010
|
|
POST
|
You are exactly right Tracy. We had a lot of difficulties where I work with this transition as well for the exact same reason. We even wrote some really ugly and unmaintainable code during that period, but after a month or two it kind of just clicks and then it gets much easier, but organizing it is always a difficult thing to figure out. Some things I've learned when moving to AMD are: Keep things simple, don't go module crazy right out of the gate and try to mimic what you see where an app has 100's of tiny modules, you'll get there eventually, larger modules make things easy during the transition but they are less maintainable. Using something like window.app = {} to store commonly shared variables or data will be a life saver, we still use this today at my workplace in almost every app. Spend some time learning what the difference between returning a Class or returning an object that contains some methods. Knowing when the appropriate time to use a Class vs a plain old object can be a lifesaver. Learn the dojoConfig. You will inevitably hit some multipleDefine errors which will possibly make you question your career choice with the lack of information/help around this issue. dojoConfig has some special options that will prevent this issue if you use it correctly. (such as aliases which will let you load jQuery through AMD instead of a global script tag, which is one of the most common causes of this error)
... View more
08-11-2015
10:14 AM
|
0
|
0
|
919
|
|
POST
|
depends where you are defining app. If you are defining app in a module you could try window.app = {}; then everywhere else in the code you can refer to it as app. If you define app in a module, it will be local to the module since define wraps the whole module. for example, define([], function () { // Anything defined anywhere in here only exists in here // If you return app as a property, then you can reuse it but then anyone who wants it must require this module // However, below would allow anyone in the program to access it. window.app = {}; });
... View more
08-11-2015
08:52 AM
|
1
|
2
|
919
|
|
POST
|
Ah ok got it, Yea the forum setup is a bit wonky sometimes. And the fact that there are two Roberts replying probably doesn't make it any less confusing haha. Seems like you have a good start though so good luck.
... View more
08-11-2015
08:36 AM
|
0
|
4
|
1129
|
|
POST
|
If app is global then it will be available everywhere without the need for you to pass it around. global variables attach themselves to the window object. I think you should be close, I don't see any reason why the code posted would return the same object from two different queries if it is creating a new array each time you query.
... View more
08-11-2015
08:20 AM
|
1
|
6
|
1129
|
|
POST
|
Did you try making codeList a local variable inside the populateCode function? Try getting rid of this.codeList altogether and using var codeList = []; inside the populateCode function. If so, can you post your populateCode code for us to see?
... View more
08-11-2015
08:02 AM
|
0
|
8
|
1129
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-08-2015 01:10 PM | |
| 1 | 08-28-2015 08:59 AM | |
| 2 | 08-31-2015 12:26 PM | |
| 1 | 08-11-2015 08:52 AM | |
| 1 | 04-13-2016 09:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|