Web Map Services + Yahoo! Maps
Hi all-
I have been playing with Yahoo! Maps API for Flash (ActionScript). It is pretty powerful. I have built a demo application that allows image based map services to be overlain on top of the Yahoo! Maps data. To do this I am customizing the Yahoo! Flash API. I am using a REST based interface to my ArcIMS map service (I could just as easily use a WMS service for this) so that I can overlay the returned map image on top of the Yahoo! Map as a customImageMarker. Here is the function that calls my custom REST service:
Here is my sample application. If you are below zoom level 4 and within the city limits of Lawrence, KS, you should see the parcel boundaries on top of the Yahoo! Map data.
http://geoportal.kgs.ku.edu/yahoomaps/overexample.html
It could be anything though...elevation contours, landcover, imagery, etc...
Now I wish you had the ability to lay custom images below the Yahoo! Map road data (ie to replace the imagery with your own)...
Try it out and let me know what you think.
Jeremy
I have been playing with Yahoo! Maps API for Flash (ActionScript). It is pretty powerful. I have built a demo application that allows image based map services to be overlain on top of the Yahoo! Maps data. To do this I am customizing the Yahoo! Flash API. I am using a REST based interface to my ArcIMS map service (I could just as easily use a WMS service for this) so that I can overlay the returned map image on top of the Yahoo! Map as a customImageMarker. Here is the function that calls my custom REST service:
function getArcIMSImage() {
var arcims_url = base_url + "BBOX="+myMap.getBounds().minLon+","
+myMap.getBounds().maxLat+","+myMap.getBounds().maxLon
+","+myMap.getBounds().minLat+"&image_width="
+myMap.getWidth()+"&image_height="
+myMap.getHeight()+"&servername="
+servername+"&mapservice="+mapservice
+"&LAYER_ID="+layer_id+"&image_type="
+image_type;
var latitude1 = myMap.getBounds().minLat;
var longitude1 = myMap.getBounds().minLon;
var LL = new LatLon (latitude1,longitude1);
myMap.addMarkerByLatLon(CustomImageMarker,LL,{url:arcims_url});
}
var arcims_url = base_url + "BBOX="+myMap.getBounds().minLon+","
+myMap.getBounds().maxLat+","+myMap.getBounds().maxLon
+","+myMap.getBounds().minLat+"&image_width="
+myMap.getWidth()+"&image_height="
+myMap.getHeight()+"&servername="
+servername+"&mapservice="+mapservice
+"&LAYER_ID="+layer_id+"&image_type="
+image_type;
var latitude1 = myMap.getBounds().minLat;
var longitude1 = myMap.getBounds().minLon;
var LL = new LatLon (latitude1,longitude1);
myMap.addMarkerByLatLon(CustomImageMarker,LL,{url:arcims_url});
}
Here is my sample application. If you are below zoom level 4 and within the city limits of Lawrence, KS, you should see the parcel boundaries on top of the Yahoo! Map data.
http://geoportal.kgs.ku.edu/yahoomaps/overexample.html
It could be anything though...elevation contours, landcover, imagery, etc...
Now I wish you had the ability to lay custom images below the Yahoo! Map road data (ie to replace the imagery with your own)...
Try it out and let me know what you think.
Jeremy
Posted by jbartley at 6:10 PM | Link | 5 comments
Subscription Options
You are not logged in, so your subscription status for this entry is unknown. You can login or register here.
Re: Web Map Services + Yahoo! Maps
Very nice and simple integration, cool stuff
Posted by mikel on April 19, 2006 at 6:21 AM
Re: Web Map Services + Yahoo! Maps
Interesting - I guess the projection is slightly off in the North/South axis, because if you drag the map half a screen up or down then the lines double up. Maybe you should remove the previous image when you add a new one?
Good stuff though - this would also work with the AJAX API I think.
Re: getting below the road layer, in the new hybrid view in the AJAX maps, the view is composited in the browser from aerial view and road layer which looks like this: http://us.i1.yimg.com/aerial.maps.yahoo.com/png?v=1.0&t=h&x=5277&y=3675&z=3
You can get a feel for how it works using the Firefox DOM inspector or the Web Developer Toolbar's 'view image information' feature.
Good stuff though - this would also work with the AJAX API I think.
Re: getting below the road layer, in the new hybrid view in the AJAX maps, the view is composited in the browser from aerial view and road layer which looks like this: http://us.i1.yimg.com/aerial.maps.yahoo.com/png?v=1.0&t=h&x=5277&y=3675&z=3
You can get a feel for how it works using the Firefox DOM inspector or the Web Developer Toolbar's 'view image information' feature.
Posted by Tom Carden on April 19, 2006 at 8:38 AM
Re: Web Map Services + Yahoo! Maps
Thanks for the comments. I fixed the pan clear issue. I forgot to implement the removeallmarkers method on dragstop. You are right, it should work with the Ajax API. I need to play around with it. The mapViews library doesn't seem to work with the Flash AS (I get a cannot find mapViews library when I try).
Also check out what we have done with map services and Google Maps here: http://geoportal.kgs.ku.edu/googlemaps
Also check out what we have done with map services and Google Maps here: http://geoportal.kgs.ku.edu/googlemaps
Posted by jbartley on April 19, 2006 at 9:12 AM
Re: Web Map Services + Yahoo! Maps
I've wanted to see a mashup talking to an ArcIMS or WMS service for some time - I don't know if most people in the mash-up world have any idea how much content is out there being served up by more traditional map image servers. Are you using a php proxy to rewrite the request from REST to ArcIMS?
Posted by Alan Brown on April 19, 2006 at 4:24 PM
Re: Web Map Services + Yahoo! Maps
You are right on Alan. There are literally a half million ArcIMS layers alone...See http://www.mapdex.org
I think we are at the tip of the iceberg in terms of image based mashups. It is a good time to be a Geographer!
I am using a ColdFusion component to translate the REST query into the proper image--parse, reproject bounding box coordinates to Mercator, request layer(or layers) from the source service (in Mercator coordinates), parse the response, and finally deliver the image back to the client. You could do it any laguage. The source is basically here: http://www.mapdex.org/blog/1/2005/09/test.cfm
Cheers,
Jeremy
I think we are at the tip of the iceberg in terms of image based mashups. It is a good time to be a Geographer!
I am using a ColdFusion component to translate the REST query into the proper image--parse, reproject bounding box coordinates to Mercator, request layer(or layers) from the source service (in Mercator coordinates), parse the response, and finally deliver the image back to the client. You could do it any laguage. The source is basically here: http://www.mapdex.org/blog/1/2005/09/test.cfm
Cheers,
Jeremy
Posted by jbartley on April 19, 2006 at 4:35 PM
Commenting has been disabled for this entry.
