[OpenLayers-Users] openlayer MapServer type layer set.

李杨 gisyangli at gmail.com
Thu Sep 6 19:47:50 PDT 2012


the index.html file and the .map file , and all the OSM data, and the
mapserv is ALL ON my SERVER where IP is  222.129.45.107, I just use another
browser to see the map by using the link "  222.129.45.107/index.html"

tks. I transfer the question to list too

2012/9/7 Stephen Woodbridge <woodbri at swoodbridge.com>

> First, please keep this questions on the list for two reasons.
> 1. so everyone can learn from the responses and they get archived so
> people can find them in web searchs
> 2. there are a lot of people on the list that can offer help and I might
> not be the best person to answer or I might be away and someone else can
> answer
>
> When you get you page into you browser where is localhost relative to the
> browser? Do you have mapserver running on the machine the browser is
> running on? or do you have it running on your server?
>
> -Steve
>
>
> On 9/6/2012 9:16 PM, 李杨 wrote:
>
>>
>> when I define with
>> .... MapServer("OSM map"," http://222.129.45.107
>> <http://222.129.45.107/> /cgi-bin/mapserv?", ... http://222.129.45.107
>> <http://222.129.45.107/> is my server IP, it will run. But when I define
>>
>> with localhost, or 127.0.0.1, it will not run?
>>
>> how is the problem?
>>
>> baseLayer = new OpenLayers.Layer.MapServer("**OSM
>> map","localhost/cgi-bin/**mapserv?",{map:"/home/jack/**
>> osm-demo/basemaps/osm-google.**map",layers:"all",map_image_**
>> type:"png"},{singleTile:true,**ratio:1.0});
>>
>>
>>
>> ------------------------------**--------------
>> this is my soucecode of the html page"
>> ----------------------
>> <!DOCTYPE html>
>>         <html>
>>         <head>
>>         <title>Openlayers Tutorial --basic maps setup</title>
>>         <script src="http://openlayers.org/**api/OpenLayers.js<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.MapServer("**OSM
>> map","localhost/cgi-bin/**mapserv?",{map:"/home/jack/**
>> osm-demo/basemaps/osm-google.**map",layers:"all",map_image_**
>> type:"png"},{singleTile:true,**ratio:1.0});
>>
>>         map.addLayer(baseLayer);
>>         map.setCenter(new OpenLayers.LonLat(0,0),1);
>>         }
>>         </script>
>>
>>         <style>
>>         @media screen
>>         {
>>         #map{width: 500px; height:250px; border: 2px solid black;}
>>
>>
>>         }
>>         </style>
>>         </head>
>>         <body onload="init()">
>>         <h3>Openlayers Tutrial-basic map Setup</h3>
>>         <div id="map"></div>
>>         </body>
>>         </html>
>>
>> ------------------------------**------------------------------**------
>> --
>> Yang Li
>> GIS Developer
>> P.R.China
>>
>>
>>
>


-- 
Yang Li
GIS Developer
P.R.China
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120907/a6e25019/attachment.html>


More information about the Users mailing list