Mapi - Simple mapping API
Hi I'm busy building a mapping API and I'm posting here for developers that might be interested in integrating maps into their project. For more info you can check out the Wiki.
Features
Features
- navigate map using mouse
- place, move & delete markers
- return routing data between two points
- create custom markers
- dynamic icon loading
- get detailed routing info and highlight routes on the map
- interact directly with the Open Street Map data
Comments
If it's the latter I'd urge you to poke @Raxter and find out what he's been using to save you some effort ;)
What I'm doing I'd use the SVG [edit: I meant XML, not SVG] data available from OpenStreetMap. I'm planning on making it stream the data from a server (right now I read off files I've downloaded onto disk)
but that is quite a far way away (I should be finishing my masters thesis as is :p) unfortunately I don't have much else to add, all that streaming off a server stuff will come after I'm more certain I have a decent game out of all of this!
@aodendaal - I will be releasing a the original source later this week. Are you interested in using this API in a project?
@raxter - I think your project is really cool, it would be very useful for developers if they could generate realistic terrain using OSM data. If you just want to download data for a specific area you can check out this link http://downloads.cloudmade.com/africa/southern_africa/south_africa#downloads_breadcrumbs. The current problem I'm having is to select an entire road, can you help me with this?
But this is with the really detailed xml file, are you extracting the xml data or just the images from OSM? Or some other method I have not realised exists? I would like to dig around your code to check myself but I don't speak JavaScript very well so it'd take too much time right now for me to figure all it out by myself (trying to finish up a thesis by the end of the month :-/ hope you understand that time is a bit tight for me atm).
Willing to help out if I can (time-depending!), I'm only just getting my head into the whole OSM stuff myself! :-P
p.s:
The height data I get from an external source, http://srtm.csi.cgiar.org/index.asp but this might have legal issues for public distribution and also no streaming web API like OSM or OpenLayers. The pic in my last post is at 90m resolution, I'm trying to get my hands on the 30m data that is also (I think) legal-issue free.
@reflex that PBF format looks like it'll be important for later editions, thanks! Currently I am scanning through the file using the c# xml parser and reading them into memory in my own format (hashmaps errywhere for fast lookups). I then create a a LineRenderer for each 'way' that is a 'highway'. Parsing and loading the whole file and creating the LineRenderers takes about 5 seconds in total (also including the time it takes to parse the heightmap file). There are about 5000 ways/LineRenderers and it runs like a badass on my i7 950 + GTX 295.
I'd be interested to start pushing the boundaries in various places. One thing I can see is that I'll probably need to combine multiple 'ways' into one to reduce the number of LineRenderers I'm creating. Also might have to have some form of level of detail scheme, 'cause up close LineRenderers don't look very road-like, but if I created geometry for all the roads the program will almost certainly start grinding. I also want to set up a streaming system whereby it'll load up data as I need it (first from files on disk, then from the interwebs or a server). But timetimeworkworkwillseewhenIcangetitdonesadface Not sure I understand you? Do you mean that for each type of road I can use a different texture? At the moment I'm using one texture for all of them, so I don't think one can beat that! It is simply grey with a dashed white line in the middle :p but I'm having texture-scaling problems since each road segment is a different length but the texture is fixed in unity. Leading to longer roads having great big white dashes and short roads with lots of little dotted dashes :P again, some time and clever tricks will be needed
http://www.namibcoder.org/mapi/
Just note that it might take some time to load the first time...
I'm integrating the OSM API into Mapi so you can get and manipulate raw map data with ease. I'm also starting to work on the interface, I'm thinking of allowing the interface to be manipulated in an external file like I'm doing with the marker icons. I'm planning on releasing version 0.2 over the weekend and update the wiki with the new features, so keep an eye open for that.
At the moment I'm using YOURS to get the routing data. An alternative to this is to calculate the route client side by getting the OSM data in an area around two points and using the Dijkstra's algorithm. This would remove the dependency on YOURS and avoid problems when their server is offline, like it was a week back, but it's not a priority at this point.
Mapi v0.15 Demo
I would love to see the cost being more than just the distance. E.g. is a tarred road faster than a dirt road. Is road D safer than road E. etc...
How about caching the results from the algorithm? This should allow for faster feedback on the site when determining the route from A to B without having to do the calculation for each and every client all over again.