Is there some kind of WMS Map Provider for modest maps? (AS3)
7
people have 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.
The best answer from the company
-
Thanks to all who contributed on this thread, and also on http://getsatisfaction.com/modestmaps...
We now have a WMSMapProvider in Modest Maps trunk:
http://modestmaps.mapstraction.com/tr...
I’m happy
The company says
this answers the question
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Not right now, because almost everything implemented so far is based off tiling schemes that match Google Maps etc.
It should be fairly simple to get Modest Maps to consume tiles from something like TileCache though: http://www.tilecache.org/
I don't know what other tiling solutions are out there for WMS - ka-map rings a bell too?
1 person says
this answers the question
-
Inappropriate?> I don't know what other tiling solutions are out there for WMS
Openlayers is a great WMS client -
Inappropriate?I've just got my modestmaps based application work with a locally installed GeoServer and TileCache. I was in fact not that hard. However, the coordinate transformation is way off. I'm trying to make it work with various maps. I've tried using the tranformation calculator without any luck. Has anyone managed to use it?
-
OpenLayers 2.6 supports coordinate transformations via proj4js -
Inappropriate?It would be very good to have WMS support in ModesMaps, it's commonly used standard in map applications. With WMS you could use MapServer and GeoServer which are widely used in commercial and industry apps.
-
Inappropriate?Hi Freaker,
I am planning to build up the same kind of application using GeoServer + TileCache + Modest Map. Would you be so kind to tell me about how it went ? -
Inappropriate?I just finished a project with with modest maps + geoserver. My shapefile is pretty large (50MB) and was taking way too long for geoserver to create the tiles dynamically so I rendered out some tiles and am using them statically.
I think geoserver has something called GeoWebCache that would help but I didn't look into it.
I'm happy answer any questions and share some code as necessary.
As for the main question I don't quite get it. Just extend the AbstractImageBasedMapProvider and write your own getTileUrl() method.
You'll have to do the math to make the correct bounding box request to your wms service ... but I did exactly this for testing alignment before I rendered of my static tile set and it worked fine and wasn't too nasty. -
Inappropriate?Hi Rjcarr,
This would be really great to get the source. I am starting now on the project, I have installed geoServer. I don't know quite were to start but if I have your source I would be able to start quicker...
Best regards -
Inappropriate?Hey Gill ... I can help but I have a few different things I'm doing so I'd like to know what you're trying to do.
If you're using geoserver and tilecache then it seems all you're doing is extending the image based map provider and overriding getTileUrl(), right?
If that's the case you just need convert your given Coordinate to a web projection based (EPSG:900913) bounding box.
If that's what you need I'd be happy to share the math to do it. -
Inappropriate?This is exactly what I think I have to do.
As my understanding stands now, what I have to do is :
1-Set up Geoserver + TileCache to work with my dataSet
2-Set up ModestMap : Change the map provider
3-Convert given coordinates to a web projection based bounding box.
Setps 1 and 2 are pretty clear but not step three.I guess It will be more clear when I have done the two first steps.
I am not applying this to a commercial project yet but I am experimenting and I want to create since I believe that geoserver + flex is a elegant web-gis solution. I emplemented Flash+MapServer+Mysql and it was really working fine.
The second step would be for me to add features to the map. But that will come after.
So I will try to go through the two first steps and I would ask for your help to get the math to do the projection.
Thanks a lot. -
Inappropriate?> 1-Set up Geoserver + TileCache to work with my dataSet
I followed the instructions on geoserver on how to add a shapefile ... it takes about 5 minutes. From there you can go to the demo sections and check out the sample map requests, you're going to want the WMS GetMap service. Sorry, I'm not using tilecache.
> 2-Set up ModestMap : Change the map provider
For this I took the AS3 flash example and added my own map provider. I was interested in a US basemap so I rendered my tiles transparent to see how they lined up to the other providers (yahoo!, ms, google). You'll just need to extend the image based map provider and set the same transformation as the other map providers (they are all the same)
> 3-Convert given coordinates to a web projection based bounding box.
This is the part that takes a little math. I'm going to put some code below and I don't think there is code support on this forum so it might get a little ugly.
Here's the interesting part of my WMS request:
private const wms:String = "wms?layers=namespace:name&srs=EPSG:900913&Format=image/png&request=GetMap&height=256&width=256&transparent=true&bbox=";
You'll need to put your own layer in there depending on what you set up in geoserver. At the end you'll noticed a dangling bbox ... that's what you have to compute given your coordinate. Here's what I did:
// radius of the earth in meters
private const Re:Number = 6378137.0;
public override function getTileUrl(coord:Coordinate): String {
var dist:Number = 2 * Math.PI * Re / Math.pow(2, coord.zoom);
var left:Number = (-1 * Math.PI * Re) + (dist * coord.column); // minlon
var right:Number = (-1 * Math.PI * Re) + (dist * (coord.column + 1)); // maxlon
// might need to scale by 85.0 / 90.0, not sure, I didn't have to
var bottom:Number = (Math.PI * Re) - (dist * (coord.row + 1)); // minlat
var top:Number = (Math.PI * Re) - (dist * (coord.row)); // maxlat
var bbox:String = "" + left + "," + bottom + "," + right + "," + top;
return wms + bbox;
}
That's it ... if you're not sure what is going on I'd be happy to explain. -
Inappropriate?Hi, rjcarr would it be possible to provide example code how you did the mapprovider? It would be great! Thanks.
-
Inappropriate?Hey Opa-
That getTileUrl() is the only unique method and I pasted it above. The constructor just sets the transformation and domain. Check any of the other providers on how to do this, they are all exactly the same. -
Inappropriate?This is a great help, very encouraging.
I have been quickly walking to step two. I was to create my new map provider.
If I look at yahoo map provider, it extends AbstractYahooMapProvider and
implements IMapProvider interface. How did you deal with you Provider class ?
Did you create an abstract class too ?
Thanks -
Inappropriate?Hey Gill ... you'd just need to extend the AbstractImageBasedMapProvider.
-
Inappropriate?there's a hacked up version here that you could build from:
http://de.pastebin.ca/1043657
it uses epsg 900913. -
Inappropriate?Intresting, could you tell us more about this source ? I can see you use Yahoo, do you also plug yourself to a GeoServer wms ?
-
Giil, that's actully using Yahoo as the base layer and a mapserver WMS overlay. but yes, you could easily use Geoserver as a WMS for the baselayer or as an overlay. -
Inappropriate?Thanks to all who contributed on this thread, and also on http://getsatisfaction.com/modestmaps...
We now have a WMSMapProvider in Modest Maps trunk:
http://modestmaps.mapstraction.com/tr...
I’m happy
The company says
this answers the question
Loading Profile...



EMPLOYEE





