porting modest maps (tiled maps like google maps) - please h

I’m porting the Modest Maps library to openFrameworks. It loads tiled map images (like Google Maps, but not Google Maps) and arranges them into a seamless multiscale map. The library was originally written for actionscript 2 but we’ve ported it and refined it in actionscript 3, python, javascript and java/processing.

Here’s my code so far:
http://github.com/RandomEtc/modestmaps-of

I am blown away by the speed, it’s really fantastic, but I would like to feel confident about stability. I’d love some input into the best way to package this up for the openFrameworks community, and also on a couple of features that are missing/flaky.

The main thing that’s missing (apart from examples, documentation, bug testing) is mouse wheel interaction. Is there an easy way to get mouse wheel input into openFrameworks? http://forum.openframeworks.cc/t/scroll-wheel-event/593/7 - thanks all! However I’m not sure it’s doing the right thing, and there’s a lot of redundant code in there and also some hacks I needed like flipping the image vertically and assigning the texture on the ui thread. It could all be cleaner and, I think, more efficient in network usage too.

Anyway, please play with the code. I’m working in XCode for Mac OS X currently. I plan to do iphone/ipad and windows testing later. Currently it’s +/- keys for zooming and left-click for panning, with a right-click-drag hack for smooth zooming.

This is great.
I found modestmaps very usefull in as3, now I must get dirty with OF and this.

Cheers.

:smiley:

Hi Tom, great stuff (love your work btw). Re: mousewheel, unfortunately that requires freeglut and I’m not sure how easy those would be to maintain across all platforms (I can’t get it to even compile under OSX). Once you have freeglut it’s pretty easy apparently, but that doesn’t really help you. It might also be trying this patch for glut http://www.realmtech.net/opengl/glut.php

hi tom,

finally got a chance to give this a spin – looks great and nice work.

the OF window system is designed to be swapable, so people have created other window wrappers besides glut: glfw, cocoa, headless, etc. glfw has support for mousewheel, and I’ve just compiled the cocoa version (off the glfw trunk) and will give your app a try with that. We don’t need to patch glut, just replace it with something more modern :slight_smile:

I’ll report back once I merge your app with glfw - (currently, I’m on my way to linz / ars, so might be a few days)

take care,
zach

Doh, lame, I completely forgot that the windows were swappable. Not to hijack this thread but is there an example around using glfw in place of GLUT? I snooped around on the boards but didn’t see anything but after getting it and compiling it looks pretty cool.

hey

here’s the code for a glfw OF window:

http://forum.openframeworks.cc/t/multisampling-ubuntu/2483/0

to use it, just change main.cpp from

  
  
#include "ofAppGlutWindow.h"  
...  
ofAppGlutWindow window;  

to:

  
#include "ofAppGLFWWindow.h"  
...  
ofAppGLFWWindow window;