[Geomoose-users] GeoMoose Map embed in webpage

Dan Little danlittle at yahoo.com
Tue Apr 12 10:18:47 EDT 2011


Hey Rick,

Sorry, I totally didn't mean to snub you on this.  I'm just bonkers busy between this an other projects.

What you'll need to do is hand-craft the WMS requests with OpenLayers.

testLayer = new OpenLAyers.Layer.WMS("WRC WMS",
"/cgi-bin/mapserv.exe",
{
layers: "county_borders",
transparent: "true",
format: "image/png",
"map" : "... your mapfile path ..."
},
{
isBaseLayer: false,
singleTile: true
});

So, really, this has nothing to do with GeoMOOSE and is just some OL coding.  If there was some sponsorship for a GeoMOOSE embeded version I could be talked into it but right now ... that would require funding or a very convincing argument that I should find it really really interesting.


   testLayer = new OpenLayers.Layer.WMS("WRC WMS", "http://gis.wrc.mnsu.edu/mnriver", {layers:"borders"});


>________________________________
>From: "Moore, Richard J" <richard.moore at mnsu.edu>
>To: "Moore, Richard J" <richard.moore at mnsu.edu>; 'Dan Little' <danlittle at yahoo.com>; "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
>Sent: Tuesday, April 12, 2011 8:47 AM
>Subject: Re: [Geomoose-users] GeoMoose Map embed in webpage
>
>
> 
>I was wondering if anyone was able to help me out on this.  I saw some work down by DM Solutions.  I appreciate all your help.
> 
>Rick
> 
>Dan and All,
> 
>I was able to get the open layers to embed in a html page.  Now onto adding data to the file.  So far I have this and was trying to add an example from the mapbook file.
> 
>In terms of the server name to load data layers I have on my server, what would be the correct name.  mnriver is a folder I created instead of geomoose2.  What would be the layers name if I used the following from the mapbook file.
> 
>Thanks,
>Rick
> 
>Mapbook_webmercator.xml
><!-- <map-source name="borders" type="wms" reference="false" projection="EPSG:900913" >
>           <url>/cgi-bin/mapserv.exe</url>
>           <param name="map" value="/ms4w/apps/mnriver/maps//demo/statedata/basemap.map"/>
>           <param name="format" value="image/png"/>
>           <param name="TRANSPARENT" value="TRUE"/>
>           <layer name="county_borders"/>
>     </map-source>  -->
> 
> 
>Embed.html
> 
><!DOCTYPE html>
><html>
>  <head>
>    <title>OpenLayers Tutorial - Basic Map Setup</title>
>    <script src="http://openlayers.org/api/OpenLayers.js"></script>
>    <script type="text/javascript">
>        var map, baseLayer;
>        function init(){
>            map = new OpenLayers.Map('map');            
>        <!--    baseLayer = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers:"basic"});  -->
>            testLayer = new OpenLayers.Layer.WMS("WRC WMS", "http://gis.wrc.mnsu.edu/mnriver", {layers:"borders"});
>       <!--     map.addLayer(baseLayer);  -->
>            map.addLayer(testLayer);
>                                                
>                                                
>                                                    layer = new OpenLayers.Layer.MapServer( "World Map",
>       "http://localhost/cgi-bin/mapserv.exe", {map: 'C:/world_mapfile.map'} );
>    map.addLayer(layer);
> 
>                                                
>                                                
>            map.setCenter(new OpenLayers.LonLat(-94,46),7);             
>        }
>    </script>
> 
>    <style>
>    @media screen
>    {
>        #map{width: 750px; height:750px; border: 2px solid black;}
>    }
>    </style>
>  </head>
>  <body onload="init()">
>    <h3>OpenLayers Tutorial - Basic Map Setup</h3>
>    <div id="map"></div>
>  </body>
></html>
> 
>Rick Moore
>GIS Research Analyst
>Water Resources Center
>Minnesota State University Mankato
>189 Trafton Science Center South
>Mankato, MN 56001
>(507) 389-3267 - Work
>(507) 381-7398 - Mobile
>richard.moore at mnsu.edu
> 
>From:Dan Little [mailto:danlittle at yahoo.com] 
>Sent: Tuesday, March 22, 2011 10:25 AM
>To: Moore, Richard J; geomoose-users at lists.sourceforge.net
>Subject: Re: [Geomoose-users] GeoMoose Map embed in webpage
> 
>You can use OpenLayers to do that.
> 
>You can use your GeoMOOSE sources (really easy if you're using WMS for most things) to play nice with OpenLayers embedded maps.
> 
> 
> 
>>From:"Moore, Richard J" <richard.moore at mnsu.edu>
>>To: "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
>>Sent: Tue, March 22, 2011 9:41:43 AM
>>Subject: [Geomoose-users] GeoMoose Map embed in webpage
>>Hi all,
>> 
>>I was wondering if it is possible to embed either the GeoMoose map into a webpage or somehow use Mapserver to embed the map on a webpage?  I am looking for something similar to how Google allows people to embed Google Maps into a webpage.   I would only need the map and navigation controls on the map.  Is this at all possible?
>> 
>>Rick Moore
>>GIS Research Analyst
>>Water Resources Center
>>Minnesota State University Mankato
>>189 Trafton Science Center South
>>Mankato, MN 56001
>>(507) 389-3267 - Work
>>(507) 381-7398 - Mobile
>>richard.moore at mnsu.edu
>> 
> 
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20110412/d031cf25/attachment.html


More information about the Geomoose-users mailing list