POST
|
It just depends on what types of devices your users are going to be using and how large the map area is going to be. For modern day web maps viewed on desktops/laptops, I like to use 1024x1024. If your map is going to be viewed on a desktop computer you are probably looking at a resolution of 1920x1080. So if your tiles are only 256x256 or 512x512 it is going to require something like 10-20 tiles to view the entire map. All of those tiles means more connections which slows things down a bit. I have been using tiles of 1024x1024 and it seems to be working out pretty well. The number of connections is much lower because not as many tiles have to be downloaded. The overall download size is about the same, but fewer connections means it feels faster. If your map is going to be used on mobile devices then 256x256 would be the way to go. I checked Google maps this morning on my desktop and they are using 256x256. But I'm guessing that a majority of their usage is from mobile devices.
... View more
11-14-2014
05:48 AM
|
0
|
0
|
790
|
POST
|
I have been running into this fire twice problem. Can you explain where this code should be placed? Using your sample page, where would this be placed? Does it go within the map.on click event? I do understand that the isMobile variable would have to be set prior. I was able to figure this out. The code does need to be placed inside the click event function. I also found out that if you are using the old connect style events you only need the following code: if ((Object.prototype.toString.call(evt).slice(8, -1) != 'MouseEvent')) Full example:
//use older connect event style
dojo.connect(map, "onClick", doIdentify);
function doIdentify(evt) {
//on mobile devices this event will fire multiple times, Check the evt to see if one that fires contains MouseEvent...if it does, ignore it.
if ((Object.prototype.toString.call(evt).slice(8, -1) != 'MouseEvent'))
{
//code for click goes here.
}
} That was all I needed to get rid of the fire twice problem. I have tested it on an Android phone, tablet and a iPad. The double firing stopped. Now, I am not using mobile view or scrollableview in my application, but I was still running into that fire twice problem on mobile devices. If you use the new "On Style" then this code will not work because "Object" will also be returned instead of "MouseEvent" on moblie devices. If you want to use the on style you'll need to use the code that greghawk posted. For now, I am going to use the old connect events so I don't have to do mobile detection, and hope that ESRI solves this problem. One issue I did run into though. If you are using esri.toolbars.Draw, the event property is only returned when using the "on" event. The connect event style only returns a geometry property. The only way to check the event would be to use the "on" style.
... View more
10-24-2013
05:40 AM
|
0
|
0
|
723
|
POST
|
Also there is an issue that when you tap/click the event fires twice. One is just an object and the other is a MouseEvent. Depending on the user agent (mobile or desktop) you need to read a different object. Here is the code to short circuit the double event and listen to the appropriate event. if ((Object.prototype.toString.call(evt).slice(8, -1) == 'MouseEvent') && isMobile || (Object.prototype.toString.call(evt).slice(8, -1) == 'Object' && !isMobile)) It is up to you how to detemine if "isMobile". I suggested checking user-agent I have been running into this fire twice problem. Can you explain where this code should be placed? Using your sample page, where would this be placed? Does it go within the map.on click event? I do understand that the isMobile variable would have to be set prior.
... View more
10-23-2013
09:33 AM
|
0
|
0
|
723
|
POST
|
Just wanted to say that this worked perfectly. Exactly what I wanted to do! Thanks! 🙂 ok - cracked the code to get all groups collapsed - as in screenshot [ATTACH=CONFIG]18426[/ATTACH] In the postcreate function find and alter as below
if (this.data._subLayerInfos) {
//acm added to collapse groups at the start
this.toggler.hide()
//end acm addition
and a bit later
//ACM also changed this line to get groups initial expand set
//dojo.addClass(this.iconNode, a ? "dijitTreeExpandoOpened" : "dijitTreeExpandoClosed")
dojo.addClass(this.iconNode, a ? "dijitTreeExpandoClosed" : "dijitTreeExpandoClosed")
So far it appears to work. The second part could be neater, but doing it this way you can see it has been changed to always return "dijitTreeExpandoClosed" ACM
... View more
08-02-2013
04:46 AM
|
0
|
0
|
646
|
POST
|
I'm glad I read this thread. I didn't realize there were other samples not listed in the table of contents. I haven't used the JavaScript API in a long time, but now I'm looking at getting into it again. It would be nice to see a listing of all the samples on a single page. The search is ok, but seeing a complete listing would be very helpful.
... View more
05-24-2013
10:52 AM
|
0
|
0
|
477
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|