locked
Custom Tiles and Performance RRS feed

  • Question

  • hey folks, me again Smile

     

    I wonder what experiences people have of custom tiles and their speed (or lack of).

     

    I've finished the work that I was discussing in a previous post, and the site is now at 'client testing' at:

     

    http://sh.suite-e.co.uk/

     

    as you will no doubt see from the site, it's very image heavy - I've used ajax wherever possible to reduce load times/page size, but the client requirements were very much geared towards a 'polished, magazine style' site, and were content that load times may well increase because of it.

     

    Now, onto the problem:

     

    http://sh.suite-e.co.uk/DalesView/

    http://sh.suite-e.co.uk/KitswellPark/

    http://sh.suite-e.co.uk/SouthgateWood/

     

    these are 3 examples of sites where we've used VE to generate extra functionality on the maps.  If you click on the plot number on the right grid, it should (if available) zoom in on the map and draw a polygon around the plot, but other than that, you will see the standard functionality in there.

     

     

    I used MSR MapCruncher to generate the tiles, then I re-engineered the zoom 18 tiles (as they were occaisionally a little small) - this isn't a problem, I just comment on it.

     

    What I'm finding is that on a zoom in, the map tiles are taking a LONG time to load.

     

    What can I do about this?  I've seen posts on custom tile server code etc., but I guess I'm more limited because I've gone for the simplicity of the MSR MapCruncher approach?  This is the first project we've done with VE, so getting into the machinations of writing my own tile server may well be something that we don't have time for based on client deadlines, but if it's needed...

     

    So, is there anything I can do to improve the performance of the custom tiles loading, speed it up in some way?

     

     

    Many thanks for all input Smile

    Kind Regards,

    Terry

     

     

    Tuesday, September 18, 2007 10:22 AM

Answers

  • doh!

     

    answered my own question - I re-generated the mapcruncher files, starting at zoom 15 with a max zoom of 18, and all is well.

     

    I'll re-generate them all at that further zoom out (oh joy!) to give me the extra flexibility.

     

    Ho hum,

    Terry

    Thursday, September 20, 2007 2:30 PM

All replies

  • Can you provide some insight into how large your individual tiles are? (e.g. 50Kb) I suspect that you rendered them as pngs, in which case the quality will look great, but it comes at a price.

     

    I did some Mapcruncher maps in png and experienced a similar situation. each time the map loaded (eg double click to zoom), it would pull almost 1 Mb of tiles.. which is quite large for the average user, especially when zooming several levels. I didnt see adequate performance until I used jpg and the tiles were in the 20Kb range.

    Tuesday, September 18, 2007 12:00 PM
  • I've not seen an option in mapcruncher to allow output to jpeg, so I guess I'd be looking at my own tileserver code if I wanted to go down this path?

     

    Average tile size seems to be about 25kb as PNGs, though the largest on some high zoom levels are 100kb+.

     

    Cheers,

    Terry

    Tuesday, September 18, 2007 12:47 PM
  • Couple of issue, download firebug for firefox, use the "net" tab and you will see your initial page size for all assets is 1.51MB and 93 files. Now you should look at combining your css files, combining your javascript and optomising both. These are a couple of great free tools:

    http://www.xtreeme.com/javascript-optimizer/

    http://flumpcakes.co.uk/css/optimiser/

     

    Seems to be two issues with your customs tiles, first they are too big. PNG is great if you want transparency to show VE tiles through, but your so much more detailed I would use jpg for there compression. I took a tile of your 70KB at a 80% jpg it is 16KB.

     

    2nd issue is its loading too many tiles, VE5 changed the way the tiles are loaded to only load what is actually in view, previously and what is happening with your layer it load an entire ring around it, so in your case your inital view needs 4 tiles but it is loading 20! What is worse is it loads off screen first, that is why it appears to take sooo long.

     

    Lastly I would gzip compression on your webserver, your page is 158KB, compression would 1/4 this for a few of your cpu cycles. Compress all your static files like css, js.

     

    I hope this helps.

    John.

     

    Tuesday, September 18, 2007 10:36 PM
    Moderator
  • Ok, decided to bite the bullet and use the VETileSourceSpecification to create my own map layer instead of the overhead of MapCruncher and its pngs.

     

    The folder of images went from 41mb to 20mb, so things look good.

     

     

    my specification was as follows:

    Code Snippet

    var bounds = [new VELatLongRectangle(new VELatLong(0.497258121401751,0.496943105412571),new VELatLong(0.502481541293559,0.502586699098748))];

     

    var layerID = "development";

    var tileSource = "http://t%2.shepherd.local/_Assets/dp/" + devPlan + "/Layer_NewLayer/%4.png";

    var tileSourceSpec = new VETileSourceSpecification(layerID, tileSource);

    tileSourceSpec.NumServers = 4;

    tileSourceSpec.Bounds = bounds;

    tileSourceSpec.MinZoom = 18;

    tileSourceSpec.MaxZoom = 21;

    tileSourceSpec.Opacity = 1.0;

    tileSourceSpec.ZIndex = 100;

     

    map.AddTileLayer(tileSourceSpec, true);

     

     

    Now this seems to work fine - it loads up the first layer of tiles (zoom level 18) and all is well.

     

    Except....  I can't zoom in any further.  I can zoom out comfortably, but zooming past level 18 just didn't seem to work.  I've read a thread on this board that discusses this, but haven't yet seen a solution to the problem.

     

    Obviously it must be possible, as the map cruncher code is achieving it, but again - hunting these forums doesn't reveal what hoops the mapcruncher code goes through to achieve a zoom level > 18.

     

    The above is going to work brilliantly for me as and when I can get the zooming working, as I've managed to farm the tiles off to multiple servers too to increase load speed.

     

     

    Heeeelllppp!

     

    Cheers,

    Terry

    Thursday, September 20, 2007 1:58 PM
  • doh!

     

    answered my own question - I re-generated the mapcruncher files, starting at zoom 15 with a max zoom of 18, and all is well.

     

    I'll re-generate them all at that further zoom out (oh joy!) to give me the extra flexibility.

     

    Ho hum,

    Terry

    Thursday, September 20, 2007 2:30 PM