As i grow to love this software more and more, i find different things that can take away from the user experience. I have found that putting polygons on the screen(mostly zip code polygons) is expensive if you use oh about 250 or more. I am working on ways around this and we are figuring some things out. One reason why a polygon is expensive is that in flash a polygon is simple correct… yes correct. Zip Code polygons are a little troublesome because of the number of points. They have great detail which is awesome when you gotta see where an exact measurement is located, but if you just need some round abouts, well, it hurts the client. By putting many of them on the screen at once your clients computers memory grows and grows. We are thinking that if we can remove about half the points, it should put them on the screen quicker, reduce the amount of memory the take up and provide the quickness that we are looking for. With that said, we are not completely sure about it. It is a good theory, but it has not been practiced to date, at least not by us.
So what i am looking to do is perhaps find a less precise data set, or rip up the current one in real time while at a certain zoom level. This should enable the XML to drop in size so the memory is not so full, and also kick up the coolness of the program. The biggest concern i have is leaving holes in the area. If i make the change to one, i have to find anyone that is using that same line and change his as well, so either my ripping algorithm must be killer, or i must be able to decipher who is using a common point. Please post your thoughts, knowledge or expertise about this topic. I am interested in hearing it. I hope that there are still some people paying attention.
Posted by Scott on March 27, 2008 at 6:15 pm
I am actually considering adding zip code polygons to my app too. I haven’t embarked on it yet, but will be shortly. I was considering simply having a checkbox on/next to the map saying “outline zipcodes”. I would add an Event listener on the map zoom to only show this option at certain zoom levels.
My hope is that, when the user checks the box, that I will be able to capture the edges of the viewable map area, extend it a bit and then request polygons only for that space.
Not sure exactly if that’s possible or how exactly I’ll handle re-querying the polygons when the user is dragging the map around and changing zoom levels, but I will have some handlers for this kind of thing.
My development is with the tiled JavaScript maps, so I need to consider performance even more than you do with Flash. I’ll keep you posted.
By the way, it’d be great to get your contact information so I have a developer I can bounce things off of here and there. If you want to, submit your contact info at http://www.arrowpointe.com/contact, that’d be great. I’ll respond with mine.
Glad to see you blogging about MQ development.
Posted by Ant on March 31, 2008 at 5:07 pm
Coupla thoughts
a) Scott – since you are in JS, check out MQLatLngCollection.generalize() to reduce shapepoints for performance. we missed this function out of AS3 5.2 – it will be in 5.3.0 for release
b) recommend you both check out 5.3.0 RC3 at http://developer.mapquest.com/beta
– look for the RemoteCollections – will allow you to loade the polys up from feeds.
– 5.3.0 also includes min/max zoom levels per shape, and also for an entire collection, which will help increase performance.
– 5.3.0 also includes Custom tile Layers, so if the zip codes were pre-rendered as tiles, performance should be great
– take a gander at http://www.mqdemo.com/contractors
Its in AS3 on 5.2 – if thats in any way helpful drop me an email (you both have my addy) and I’ll send you more details on what I did
HTH
Ant
Posted by mqguru on April 1, 2008 at 4:24 pm
Wow I love this. Thanks for the thoughts ANT. I will be checking them out soon. I will make sure to check out the generalize function or whatever it might be called in 5.3 Also need to dig into the tile map stuff more. I will be looking into that and get back with you on how that works for us. Thanks for the great tips and glad to have to read.