Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Google Maps API - What I've been working on.

  1. #1
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post Google Maps API - What I've been working on.

    I know I've been kinda quiet lately, and I have a bunch of plans on my plate (such as the featured map block) but this just couldn't wait.

    I FINALLY cracked the code of the Google maps API...I've figured it out, and I plan on eventually sharing the secret with you all...but for now:

    http://www.cartographersguild.com/mapview/arsala.html

    This is my campaign map, and its unfinished and unpolished...and I only have implemented 2 zoom levels. I also forgot to turn on the sheet effects for the second zoom level.

    BUT, this is a CC2 map viewed in the Google Maps API, and I like it. The only thing I don't liek is the file sizes...holy crap...The 2 zoom levels I have here is about 5 megabytes. Thats a lot of space for a map online I guess...and of course google isn't hosting the map, only the API.

    I look forward to your thoughts and opinions.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

  2. #2
    Guild Novice Intermagus's Avatar
    Join Date
    Oct 2006
    Location
    Springfield, Missouri
    Posts
    8

    Post

    Excellent.....this is exactly what I've needed. With the CC2 maps, a file compression would be in order. With my painted PNG maps, I can use the PSP software to compress the files into something more manageable (conversions from MB to KB in most cases except the the truly huge maps I've painted, but even then they compress a 25MB file into the 5MB files you are wanting to abstain from).

    I suppose if you were to export the CC2 or CC3 map to a picture file, then the image editor compression can be employed, could it not?

  3. #3
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post

    well, the image consists of tiles that the google map api overlays or replaces with the google tiles. The tiles are created by loading a map into Photoshop and running a script that chops the map up into tiles and names them automatically. The magical formular is figuring out how to name the tiles and how to use those names in your api script...its a beast.

    Here's what a tile looks like on the server.
    http://www.cartographersguild.com/ma...ala/13_8_4.jpg

    I used a jpeg compression rate of 8 (12 being highest quality largest filesize) and could probably go lower if I wanted to, and I intend to experiment with lower numbers in the future. Especially when I add my next zoom level.

    If the maximum zoom level displays a 1280x1024 map...then the next closest zoom level shows a 2560x2048 map, and the next one shows a 5120x4096, and so forth, doubling in size each time. So you can see how quickly the file sizes will add up on these.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

  4. #4
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post

    And I just added a higher zoom level...but it doesn't seem to line up as well.

    When you load the page you are at the max zoom level...there are two more closer zoom levels.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

  5. #5
    Community Leader RPMiller's Avatar
    Join Date
    Apr 2006
    Location
    Watching you from in here
    Posts
    3,226

    Post

    This is really great! My very first nitpic would be that the jpgs are losing so much clarity that as you zoom in they get really blurry. Is there a way to use PNGs instead? They would be a lot clearer and maybe a bit smaller as, IIRC, PNGs have a better compression ratio.

    Also the map seemed to 'jump' around in the applet from when it first reloaded to when I zoomed back out. It seemed to shift to the left.

    Ultimately though I have to say that you ROCK! and I'm looking forward to seeing how to put this together for my own world map... which I need to finish one of these days.

  6. #6
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post

    Quote Originally Posted by RPMiller
    This is really great! My very first nitpic would be that the jpgs are losing so much clarity that as you zoom in they get really blurry. Is there a way to use PNGs instead? They would be a lot clearer and maybe a bit smaller as, IIRC, PNGs have a better compression ratio.
    The three zoom levels are individual images...they are never enlarged or anything. The poorer quality I think you're mentioning is actually from things not rendering well at that size in CC3. For example, when you zoom from the max view, to the middle zoom level, a whole new set of jpegs is loaded as opposed to the map being zoomed in by enlarging existing images. The third zoom level (where one continent has some symbol detail) didn't render very well...a lot of the fonts are unreadable and things are kinda jumpy...Thats the way it came out of CC3, I just sliced it. I am going to try pngs though, just to see what kind of difference it makes.

    Also the map seemed to 'jump' around in the applet from when it first reloaded to when I zoomed back out. It seemed to shift to the left.
    The maximum view zoom level does not line up with the others for some reason. Therefore when you zoom back out, you don't quite get what you expect because the tiles aren't related properly. I'm working on it.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

  7. #7
    Community Leader RPMiller's Avatar
    Join Date
    Apr 2006
    Location
    Watching you from in here
    Posts
    3,226

    Post

    I'll be very interested in seeing the pngs vs. jpgs. I suspect that they will render better.

    I'll say again, thank you very much for your work on this and I will look forward to seeing the project evolve and get used by everyone.

  8. #8
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post

    Unfortunately there doesn't seem to be an Adobe Scripting way to save a png-8...the pngsaveoptions don't have a method to specify compression or 8-bit, or colors or anything

    Anybody got any ideas?

    Looks like I'm stuck with jpeg or gif for now.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

  9. #9
    Community Leader RPMiller's Avatar
    Join Date
    Apr 2006
    Location
    Watching you from in here
    Posts
    3,226

    Post

    Unfortunately Adobe Scripting is something I haven't looked into so you won't be getting any love from my direction, but I can give some sympathy.

  10. #10
    Administrator Facebook Connected Robbie's Avatar
    Join Date
    Mar 2006
    Location
    Dayton, OH
    Posts
    3,868
    Blog Entries
    6

    Post

    I just redid it...so go look again and refresh if you haven't.

    I wanted to further get an idea of the ranges with which I have to work. I figured it out. Here's a chart:

    Zoom Level 0: 1x1 tiles (0) - 256x256 px
    Zoom Level 1: 2x2 tiles (0-1) - 512x512 px
    Zoom Level 2: 4x4 tiles (0-3) - 1024x1024 px
    Zoom Level 3: 8x8 tiles (0-7) - 2048x2048 px
    Zoom Level 4: 16x16 tiles (0-15) - 4096x4096 px
    Zoom Level 5: 32x32 tiles (0-31) - 8192x8192 px
    Zoom Level 6: 64x64 tiles (0-63) - 16384x16384 px
    Zoom Level 7: 128x128 tiles (0-127) - 32768x32768 px

    I recreated the map utilizing the first 5 zoom levels (0-4)...So the full zoom is 4096x4096 pixels...not too shabby. But I think I'm getting somewhere with this now that I have an idea of how it places the tiles.
    All Hail FlappyMap! Long Live MapFeed!

    Robbie Powell - Site Admin

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •