Concepting a MAP script from a huge JPG image

Discussion in 'PHP' started by aka_eu, Nov 27, 2006.

  1. #1
    Hi,

    I need to develop a new feature from one of my websites and I am not sure how to concept the project to match my requirements. That's why I'm looking for your suggestions to avoid mistakes before losing some days of developing

    I have a huge file for the moment it's in Corel Draw but can be simply exported to any image format, file that contain the MAP of my city.

    I want to add this map to my own city portal in a more friendly way

    I want users to see at one moment an image (or image collation) for a size of 300x300 px
    - zoom possible until a level that I will choose
    - move left,right,top,down
    - set on the map coordinates for some location ( and that need to be shown as here ( an alistapart.com tutorial http://www.alistapart.com/d/cssmaps/mapfinal/index.html )

    I was thinking of generating 7 maps one per each zoom level that I want users to have access.

    For each level of images to cut the map in many pieces so at the final when the user want to see some zone at let's say 5th level the user to see actually 9 small images that form that large image of 300x300px (I'm thinking also to pregenerate all the possible combinations for each level of zoom to avoid memory usage when users will browse the map).

    For now if I will generate all these images I will have to put into the DB these info for each generated zone.
    - starting coordinates (XY from the original TOP LEFT corner)
    - ending coordinates
    - id of the images that will correspond to left, top, right, bottom movements over the map
    - id of the zoom OUT and also for the zoom IN (if applicable)

    So what do you thing until now my concept is good or completely wrong ?

    Of course that I also have some questions on how to generate all that images for different zooms level

    Here I thought to export from CDraw 7 different images with the complete map but for width different resolutions
    1: 300x300
    2: 600x600
    3: 1200x1200
    4: 2400x2400
    5: 4800x4800 (I'm actually thinking of stopping here actually because of the huge resources that I will need from my server to store the images)
    6: 9600x9600
    7: 19200x19200

    For each image I should make a PHP script of maybe I will write a standalone application in (VB or C++) that will generate all the images

    For example
    - for the level 3 (1200x1200) I will have to generate
    100 images
    - for the level 4 (2400x2400) I will have to generate
    484 images
    ....

    Any suggestions ?
     
    aka_eu, Nov 27, 2006 IP