| | |
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 ajaxexample ajaxjspservlets array beta box browser captchaformproblem cart child class close codes column css date debugger decimal dependent design disablefirebug dom download editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index java javascript javascripthelp2020 jquery jsf jsp jump libcurl listbox maps masterpage math media menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php player position post problem programming prototype redirect safari scale scriptlets scroll search security select software toggle unicode variables w3c web window windowofwords \n





