[OpenLayers-Users] How to SetUp Open Layers for an XML/WMS Service

Slawomir Messner slawomir.messner at staff.uni-marburg.de
Wed Jun 30 02:38:49 EDT 2010


   You forgot the comma in the json object.

var map = new OpenLayers.Map('map', {

maxExtent: new OpenLayers.Bounds(545130525,258147752,546437807,259455034),

maxResolution: 5000

} );



Am 30.06.2010 08:35, schrieb Kalyan Kamepalli:
>
> Hi Christopher,
>
> I did replace my map creation with your bit of code and that didn’t 
> help me. My browser turn up with an error saying expected ‘}’. I just 
> couldn’t find where did I miss that one. Here’s my code
>
> <script type="text/javascript">
>
> //var map = new OpenLayers.Map('map',{maxResolution: 1000} );
>
> var map = new OpenLayers.Map('map', {
>
> maxExtent: new OpenLayers.Bounds(545130525,258147752,546437807,259455034)
>
> maxResolution: 5000
>
> } );
>
> var wmscURL = [
>
> "http://BECKS:8080/gss/ogc?version=1.3.0&crs=sw:uk_british_national_grid_mm 
> <http://BECKS:8080/gss/ogc?version=1.3.0&crs=sw:uk_british_national_grid_mm>"
>
> ];
>
> var smallworldLayer = new OpenLayers.Layer.WMS( 'Cambridge Steet' , 
> wmscURL , { layers: '' , format: 'image/jpeg'} , { buffer: 1 , 
> isBaseLayer: true } );
>
> map.addLayer( smallworldLayer );
>
> map.zoomToMaxExtent();
>
> </script>
>
>
>
>
> On Wed, Jun 30, 2010 at 4:08 PM, <christopher.schmidt at nokia.com 
> <mailto:christopher.schmidt at nokia.com>> wrote:
>
>
>     On Jun 30, 2010, at 1:58 AM, ext Kalyan Kamepalli wrote:
>
>     > Yahoo !! I made some progress,
>     >
>     > I actually didn’t know that I have to create a layer for the map
>     object. I now created one later and added it to map object.
>     Excellent. It worked. I got my map. But, I am not happy with the
>     quality/resolution of the map. I then set the maxResolution
>     property of the map from 0.73 to 1. That didn’t help me either. Is
>     there anything else I should do to improve it’s quality ? The same
>     WMS direct call results in a high quality map from my server.
>
>     Remove the width, height, and bbox from your URL. then change your
>     map creation to:
>
>      Map('map', {
>            maxExtent: new
>     OpenLayers.Bounds(545130525,258147752,546437807,259455034)
>            maxResolution: 5000
>      });
>
>     Your Layer URL should then look like:
>
>      "http://localhost:8080/gss/ogc?version=1.3.0&crs=sw:uk_british_national_grid_mm
>     <http://localhost:8080/gss/ogc?version=1.3.0&crs=sw:uk_british_national_grid_mm>"
>
>     Does the behavior improve?
>
>     -- Chris
>
>     > Any help is greatly appreciated.
>     >
>     > Thanks,
>     > Kalyan
>     >
>     >
>     > On Wed, Jun 30, 2010 at 1:41 PM, Kalyan Kamepalli
>     <kalyan.kamepalli at gmail.com <mailto:kalyan.kamepalli at gmail.com>>
>     wrote:
>     > Hi group,
>     >
>     > I do have a WMS service with my product, I am actually trying to
>     use Smallworld Geospatial Server with WMS service. I just found
>     one example using WMS service and trying to edit it to work with
>     my service call. I changed the script section as follows
>     >
>     > <script type="text/javascript">
>     >             var map = new OpenLayers.Map('map',{maxResolution:
>     0.703125} );
>     >             var wmscURL = [
>     >                        
>     "http://localhost:8080/gss/ogc?request=GetMap&service=WMS&version=1.3.0&width=600&height=600&format=image/jpeg&bbox=545130525,258147752,546437807,259455034&crs=sw:uk_british_national_grid_mm
>     <http://localhost:8080/gss/ogc?request=GetMap&service=WMS&version=1.3.0&width=600&height=600&format=image/jpeg&bbox=545130525,258147752,546437807,259455034&crs=sw:uk_british_national_grid_mm>"
>     >                                                
>     //"http://wmsc1.terrapages.net/getmap?",
>     >                                                
>     //"http://wmsc2.terrapages.net/getmap?",
>     >                                                
>     //"http://wmsc3.terrapages.net/getmap?",
>     >                                                
>     //"http://wmsc4.terrapages.net/getmap?"
>     >                                                 ];
>     >             //var terrapagesStreetLayer = new
>     OpenLayers.Layer.WMS( 'TerraPages Street',wmscURL, {layers:
>     'UnprojectedStreet', format: 'image/jpeg' }, {buffer: 1,
>     isBaseLayer: true} );
>     >             //map.addLayer(terrapagesStreetLayer);
>     >             map.zoomToMaxExtent();
>     > </script>
>     >
>     > As I don’t want to display any other map, I commented those 4
>     map requests and included my request. But, It doesn’t give me any
>     map. What could be reason for that ??
>     > If I use the same URL directly from a browser, I could see a
>     map.  Is there something I am missing ? or is it not the way to
>     call a map service ??
>     >
>     > Thanks,
>     > Kalyan
>     >
>     > On Tue, Jun 29, 2010 at 5:05 PM, Zac Spitzer
>     <zac.spitzer at gmail.com <mailto:zac.spitzer at gmail.com>> wrote:
>     > have a look thru the examples
>     >
>     > http://www.openlayers.org/dev/examples/
>     >
>     > that should be a good starting point, use view source to see how
>     things are done
>     >
>     > z
>     >
>     > On 29 June 2010 13:44, Kalyan Kamepalli
>     <kalyan.kamepalli at gmail.com <mailto:kalyan.kamepalli at gmail.com>>
>     wrote:
>     > > Hello Everyone,
>     > >
>     > >
>     > >
>     > > I am new to Java Script and thus Open Layers. I have an
>     application server
>     > > that provides a map service and many other services like
>     select, zoom in
>     > > zoom out.I wanted to map them on to Open layers and finally
>     embed open
>     > > layers on to a website. The map service is an XML based and it
>     generates an
>     > > XML response.I also have WMS services that respond in WMS format.
>     > >
>     > >
>     > >
>     > > Could someone share me the procedure to make the above process
>     to work
>     > > please. I know a bit of Java Script. Like how it works and how
>     to code in it
>     > > and the function,Object structure of it. But, I never worked
>     on it.
>     > >
>     > >
>     > >
>     > > Regards,
>     > >
>     > > Kalyan
>     > >
>     > >
>     > >
>     > > _______________________________________________
>     > > Users mailing list
>     > > Users at openlayers.org <mailto:Users at openlayers.org>
>     > > http://openlayers.org/mailman/listinfo/users
>     > >
>     > >
>     >
>     >
>     >
>     > --
>     > Zac Spitzer
>     > Solution Architect / Director
>     > Ennoble Consultancy Australia
>     > http://www.ennoble.com.au <http://www.ennoble.com.au/>
>     > http://zacster.blogspot.com <http://zacster.blogspot.com/>
>     > +61 405 847 168
>     >
>     >
>     > <ATT00001..txt>
>
>     Regards,
>     --
>     Christopher Schmidt
>     Nokia
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
-----------------------------------------------
Slawomir Messner
Forschungszentrum "Deutscher Sprachatlas"
06421-28-24981

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100630/ce83326c/attachment.html


More information about the Users mailing list