| | |
Continuously Scrolling Map
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 2
Reputation:
Solved Threads: 0
I'm working on a problem that I thought would be common but so far I haven't been able to find a good solution.
I need to create a scrolling map that works similar to google maps (only more simplistic). The page will display a 500X500 pixel image which is itself made up of 25 100px blocks. The user will be able to move in any direction by clicking arrows on the perimeter of the map.
The 500px image is part of a much larger image. The pieces of which are stored on a server in 100px squares.
One click should advance the map 500px in the selected direction thereby completely replacing the original image.
I was thinking that I would initially load 9 separate images (the center image plus 8 hidden images in each direction N,S,E,W,NE,NW,SE,SW). All would be held in divs and the individual 100px blocks would be in tables within the divs.
When a user advances in any direction, an ajax call would be made to pre-load a new image in that direction so they can continue to move around the map without delay.
I'm afraid that I'm going to spend a lot of time coming up with my own way of doing this only to find that there is a common approach that works better. Seems like this sort of thing would be done all the time in web-based games like Tribal Wars and Fallen Sword.
Is anyone aware of a good example of how something like this is done? I've been looking for two days and haven't found anything yet. Maybe there's a name for this behavior and I'm unaware of it?
Not sure that it matters but I'm using ASP.Net with the Ajax Toolkit. I'm also considering jQuery for some areas where performance might be an issue.
Thanks for the help!
I need to create a scrolling map that works similar to google maps (only more simplistic). The page will display a 500X500 pixel image which is itself made up of 25 100px blocks. The user will be able to move in any direction by clicking arrows on the perimeter of the map.
The 500px image is part of a much larger image. The pieces of which are stored on a server in 100px squares.
One click should advance the map 500px in the selected direction thereby completely replacing the original image.
I was thinking that I would initially load 9 separate images (the center image plus 8 hidden images in each direction N,S,E,W,NE,NW,SE,SW). All would be held in divs and the individual 100px blocks would be in tables within the divs.
When a user advances in any direction, an ajax call would be made to pre-load a new image in that direction so they can continue to move around the map without delay.
I'm afraid that I'm going to spend a lot of time coming up with my own way of doing this only to find that there is a common approach that works better. Seems like this sort of thing would be done all the time in web-based games like Tribal Wars and Fallen Sword.
Is anyone aware of a good example of how something like this is done? I've been looking for two days and haven't found anything yet. Maybe there's a name for this behavior and I'm unaware of it?
Not sure that it matters but I'm using ASP.Net with the Ajax Toolkit. I'm also considering jQuery for some areas where performance might be an issue.
Thanks for the help!
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Combining CSS and Javascript files into single HTML file [HELP NEEDED]
- Next Thread: div show/hide
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp animate automatically beta box bug calendar captcha cart checkbox child class column cookies createrange() css cursor decimal design dom download dropdown editor element engine enter error events explorer file focus form forms frameworks google gwt html htmlform ie8 iframe image() images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jump listbox math matrixcaptcha menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent pdf php player post problem progressbar prototype rated rating regex runtime scale scroll search select session shopping size sql star starrating stars text textarea validation w3c web website window windowofwords windowsxp wysiwyg xml \n





