Single Image MapProvider
Hello ModestMappers!
We are trying to use ModestMaps to implement a floorplan viewer. We would like to reuse the pan and zoom functionality of MM, but our image sizes don't warrant slicing up into tiles. Just scaling them as a zoom is perfect.
At first I was trying them as Overlays (or even markers, maybe), but it seems like I should be able to create my own MapProvider that only ever returns a single image at the middle zoom level and lets the zoom in/out levels scale from that middle level.
This kind of works, but I need help. What should I be doing in terms of Transformations and Projections? How do I specify the boundaries? What should my getTileUrls function look like?
Thanks in advance for any advice!
We are trying to use ModestMaps to implement a floorplan viewer. We would like to reuse the pan and zoom functionality of MM, but our image sizes don't warrant slicing up into tiles. Just scaling them as a zoom is perfect.
At first I was trying them as Overlays (or even markers, maybe), but it seems like I should be able to create my own MapProvider that only ever returns a single image at the middle zoom level and lets the zoom in/out levels scale from that middle level.
This kind of works, but I need help. What should I be doing in terms of Transformations and Projections? How do I specify the boundaries? What should my getTileUrls function look like?
Thanks in advance for any advice!
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Sorry to be blunt, but Modest Maps is for tiles. If you don't need tiles then you don't need Modest Maps. All the projection and transformation stuff is overkill for you.
Here's an example of how to pan and zoom in Flash - http://gasi.ch/blog/zooming-in-flash-... -
Inappropriate?I appreciate your sentiment, but we aren't doing this just for those pieces of functionality. Some floorplans will actually be maps. Some floorplans will be an image hovering over a map. All floorplans will need to make use of markers, etc. We have PLENTY of need for MM features, we just need to evaluate whether we can make this simple first step work.
So, is it the case that MM simply cannot support a single-image, single-tile provider that can zoom in or out once (and just relaying on image scaling instead of loading new tiles)?
I could also roll my own and just tie it into the MM events (somewhat like the multi-map provider examples I've seen on here.) It just seems like this should be possible pretty trivially with a robust tool such as this?
I’m unsure
-
Inappropriate?OK, if you say so. I still think if you have a single image then you should forget all the provider/projection/tileURL stuff. It really is overkill. If you forget all that then there's really not much to Modest Maps at all... the above tutorial on panning and zooming gets you most of the way there.
Nevertheless, if you *do* have tile bases for some stuff, or if you're really looking for something to handle latitude longitude maths for you, then read on...
If you're trying to add a single image as an overlay (on top of tiles) that will scale/translate according to the pan and zoom of the map then you might be interested in the solution here http://getsatisfaction.com/modestmaps...
Given that your image overlay will be acting as a basemap you'll want to ensure it's underneath any other markers you add. You can do this by creating an additional MarkerClip instance and adding it as a child of Map. (There's one built in by default that Map.putMarker uses, but you can have as many as you like).
For maps that don't have tiles you can create a provider that simply returns an empty array in the getTileURLs function. Depending on whether your floor plans are large enough to use geographic coordinates (latitude/longitude) then you might want to reuse the projection/transformation from an existing MS/Yahoo/Google style provider or you might want to create your own.
See http://modestmaps.com/calculator.html for how to generate the transforms or use code from http://modestmaps.mapstraction.com/tr... to create a projection from three lat/lon Locations and three x/y Points.
I’m still skeptical
Loading Profile...



EMPLOYEE