Recent activity
Subscribe to this feed-
Eufemism started following the question "smoothly Zoom in and out" in Modest Maps.
-
Eufemism started following the question "smoothly Zoom in and out" in Modest Maps.
-
Eufemism started following the question "How can I implement a double-click to zoom function?" in Modest Maps.
Eufemism replied on March 20, 2008 14:00 to the question "How to limit zoom and pan" in Modest Maps:
migurski: I tried but I don't get any results, I'm probably doing this in the wrong way/place but I'm trying to keep most of my stuff in a class called MapManager, where I added:
mapHolder.map.__mapProvider.__topLeftOutLimit = mapHolder.map.__mapProvider.locationCoordinate(new Location(72.1279, -19.4238));
mapHolder.map.__mapProvider.__bottomRightInLimit = mapHolder.map.__mapProvider.locationCoordinate(new Location(52.6964, 46.2305));
But apparently this doesn't work, so do I have to put it all in the MapProvider for the map I'll be using?
And a tutorial would be very much appreciated
gwfran: I tried your version and got the width/height with some trial and error and I got it to work, but as soon as I start zooming everything get's messed up and I ended up zoomed in on the ocean near Alaska, and my values only worked with zoom levels defined as 4 and 7, when I changed the 7 everything got messed up again.
This is very much a new territory for me and I'm greatful of all your help!
Eufemism replied on March 19, 2008 20:59 to the question "How to limit zoom and pan" in Modest Maps:
Eufemism replied on March 19, 2008 20:05 to the question "How to limit zoom and pan" in Modest Maps:
Thanks for the quick replies guys!
But I'm still having problems, I just feel I don't understand anything about all these coordinates and values and no matter what I try I get really strange results, what I'm trying to do is to limit google/microsoft/yahoo maps to zoom level between 4 and 15/16, and limit the panning to an area around Norway/Sweden/Finland (zoom level 4 because it makes the entire height of the countries visible)
Is there any way I can use the long/lat coordinates of the top-left corner of the map and the coordinates of the bottom-right corner (after I've panned and zoomed to the area I want) to limit the pannable/zoomable area?-
Eufemism started following the question "How to limit zoom and pan" in Modest Maps.
Eufemism replied on March 19, 2008 14:40 to the question "How to limit zoom and pan" in Modest Maps:
-
Eufemism started following the question "Newbie questions / mapExtent / missing tiles / zoom-limit" in Modest Maps.
Eufemism marked one of RandomEtc's replies in Modest Maps as useful. RandomEtc replied to the problem "Can you pan, zoom and preload tiles with one function?".
-
Eufemism started following the problem "Updated Google Tiles" in Modest Maps.
Eufemism replied on March 18, 2008 10:42 to the problem "Can you pan, zoom and preload tiles with one function?" in Modest Maps:
Wow, thanks for the response!
The biggest problem for me now is that I'll have to use the AS2 version, and the zoom can't seem to zoom in on the center (if I first pan to where I want and then zoom it ends up in the wrong place)
The preloading is probably to much for me to do now as I'm running low on time for this project, but to get the zoom to zoom in on a lat/long coordinate is a pretty high priority. With this solved a zoom out-pan-zoom in like iPhone GMaps wouldn't be very hard (except you'll still end up with very pixelated tiles without a preload function)
Another thing I'm going to try is to expand the cache to keep more tiles in memory to reduce requests to the maps server, and also fading of tiles, so when you zoom in it keeps the old bigger tiles visible and then fades in new tiles on top of them for a more seamless experience.
Also, smooth zooming and panning like flashearth.com would be awesome, and maybe even the ability to throw the map around like the scrolling on the iPhone.
Another thing(perhaps in need of another topic) is grouping of markers when you zoom out, I figured out how to do this more or less manually, where you set a max and min zoom level for where a marker is visible and then set a parent marker that gets drawn when the child markers are hidden, eg. marker1 and 2 are visible on levels 6 to 17, and their parent is visible between 1 and 5. But modest maps could probably benefit from a more automatic version of this (when a bunch of markers are more or less on top of each other they get replaced by a single marker)
If anything of this is doable any hints on how to do it is very appreciated, I will post any solutions I find on the way.
Eufemism reported a problem in Modest Maps on March 17, 2008 10:13:
Can you pan, zoom and preload tiles with one function?I kinda need a zoom and pan function that zooms in on a location, I made one using existing pan and zoom functions but it totally misses it's target, this is the code and it's basically a mashup of the panTo and zoomTo functions by "Cupcake 18971"
public function panAndZoomTo(targetLoc:Location, zoomTarget:Number) {
var centerPoint:Point = locationPoint(__mapProvider.coordinateLocation(grid.centerCoordinate()), grid);
var targetPoint:Point = locationPoint(targetLoc, grid);
var distance:Point = new Point(Math.round((targetPoint.x - centerPoint.x) / panAndZoomFrames), Math.round((targetPoint.y - centerPoint.y) / panAndZoomFrames));
var levelDelta:Number = zoomTarget - grid.zoomLevel;
for(var i = 1; i <= panAndZoomFrames; i += 1) {
__animSteps.push({type: 'pan', amount: distance});
__animSteps.push({type: 'zoom', amount: ((1/zoomFrames) * levelDelta), redraw: true});
}
if(!__animTask) {
__startingZoom = grid.zoomLevel;
__currentZoom = grid.zoomLevel;
__startingPosition = new Point(grid._x, grid._y);
__currentPosition = new Point(grid._x, grid._y);
onStartPan();
onStartZoom();
animationProcess();
}
}
Is this even possible? Also as a bonus, I'd like it to preload the tiles around the target location to avoid gigantic pixels.
Thanks in advance!
Loading Profile...
