Zooming In/Out in Flash Based web maps.
#1
Posted 20 April 2007 - 04:28 PM
I'm about 5 hours into coding the actionscript for the flash map (I've not coded flash in 2 years, so it's taken me a while to get the hang of it again)... I've run into a snag with the zooming function of the website. I dont know of any better way to do it, so I'm using scale function and a bunch of custom flag vars to indicate the depth of zoom and whatnot.
I'm having trouble with the part where the area of focus (center of the square) is always being pushed outward as you zoom in, due to the fact that the scaling of any object is done by pushing out the corners, so in turn, the target area gets pushed out as well, and you lose your spot on the map.
Also, I've not yet figured out a way to do map bounds so that it does not let you go passed the edges of the map.
Please keep in mind that parts of the map will have to be able to be turned off and such.. like routes and roads.
Here is a quick link to the progress page.
Northern Ontario Trail Map
#2
Posted 20 April 2007 - 11:19 PM
If you want to keep it centered, I would suggest to calculate the center of the viewport at time of zoom click, and then recenter the map after you zoom in. You can do this using screen, bound, or lat/lng coords. But since you do not have click-and-drag functionality for panning on the map, I think this might confuse the user anyway.
BTW great script! I would love to get my hands on the code
#3
Posted 23 April 2007 - 09:47 AM
Regarding zooming and keeping the center, you will notice that Google Maps does not correct for this.
If you want to keep it centered, I would suggest to calculate the center of the viewport at time of zoom click, and then recenter the map after you zoom in. You can do this using screen, bound, or lat/lng coords. But since you do not have click-and-drag functionality for panning on the map, I think this might confuse the user anyway.
BTW great script! I would love to get my hands on the codeActionScript is a beast.
thanks =)
how would i find these screen/bound functions. I've searched for them before, but came back with little to nothing in terms of useable actionscript. the coders seem to have made their versions too hard to strip.
And what version of flash does bound/screen take effect? the nav controls on the side are using flash 6.0 actionscript 1.0 coding, so, im not sure if i would have to find out how to recode that to work for flash8 or whatever.
im not the greatest at flash =/
#4
Posted 23 April 2007 - 06:31 PM
he responded to my email a few months ago.
also you should check out http://www.worldkit.org, and you can try asking the developer there or using their message board/forum/listserv, whatever they have.
also i know for me the Google Maps API Discussion Group was really good, so if you search on http://groups.google.com its basically the old Usenet plus new stuff.
#5
Posted 01 May 2007 - 02:54 PM
and within the zoom layer, put a "MAP" Layer that has all the movie clips that contain all the levels of mapping that you need (water, roads, buildings, highways, parks and rec).
on your navigation (N,E,S,W) you would make it move the MAP layer. that way when you ZOOM in, the ZOOM layer which contains the MAP layer is still zooming in the center, and the MAP layer is the one that moves around, not the ZOOMING layer itself.
make sense to everyone?
I would upload the code, but I am not the originator of some of it, and it's under my companies privacy policy to withold scripts that have been paid for from a third-party.
Any questions though, please ask.
#6
Posted 02 May 2007 - 04:38 PM
Here's the latest update on the file
http://coa.wireballcreative.net/
anyone know how to get rid of stack errors? one of my layers has 8000 vertices, so i doubt i can export anything. But i have managed to slim down the file (lakes), and use a PNG for the names.
These are all loaded in external SWF files, placed in an external movie clip. This allows me more space per individual layer.
Next on the list is:
Trail Routes for OBR and OTC.
Trail Tooltips for mousing over each trail and seeing which one it is.
and Preloaders with some little dudes riding bikes =)
Then i have to do the SOUTHERN Ontario file. oh gosh =/
any questions....ask away =D
#7
Posted 14 October 2008 - 02:38 AM
Hey everyone,
Here's the latest update on the file
http://coa.wireballcreative.net/
anyone know how to get rid of stack errors? one of my layers has 8000 vertices, so i doubt i can export anything. But i have managed to slim down the file (lakes), and use a PNG for the names.
These are all loaded in external SWF files, placed in an external movie clip. This allows me more space per individual layer.
Next on the list is:
Trail Routes for OBR and OTC.
Trail Tooltips for mousing over each trail and seeing which one it is.
and Preloaders with some little dudes riding bikes =)
Then i have to do the SOUTHERN Ontario file. oh gosh =/
any questions....ask away =D
Hi Careless
I'm having same problem , still i can not find a solution how to do that ,I think you may find a solution can you please upload a sample code
please
Dilshan
#8
Posted 04 September 2009 - 07:59 PM
#9
Posted 10 March 2011 - 04:24 PM
#10
Posted 12 August 2011 - 03:22 AM
This is one thing I hate about Google maps. It does the same thing. I basically have to center the map every time I zoom in or out. You would think there would be a lock function to where you could point to a certain point on the map to center it and then lock it. But I guess if Google can't do it then it's not possible.
I' ve read they are working on it
#11
Posted 15 August 2011 - 01:19 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account
Canada
Back to top
United States
Sri Lanka
No Country Selected








