[MS4W-Users] Getting tiles to OpenLayers

Vogt, Robert (RCIS) Robert.Vogt at rcis.com
Mon May 23 10:51:35 EDT 2016


Good morning,

I am pretty new at this so please excuse me if I seem less than knowledgeable about this. :)

I have gone through the documentation to get ms4w set up and believe I have it running, I am also upgrading from OpenLayers to OpenLayers3 and am having a difficult time translating how my new map will get the custom base layer from my server.

The code I currently have relies on a "passthrough" website that points at mapserv.exe and passes the path of the .map file it's trying to get, this doesn't seem to be working...

My current code looks like this....

map = new OpenLayers.Map({
                div: "divMap",
                controls: [new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.Navigation({ documentDrag: true }),new OpenLayers.Control.TouchNavigation({dragPanOptions: {enableKinetic: true}})],
                numZoomLevels:20
            });

wms = new OpenLayers.Layer.WMS();



msBase = new OpenLayers.Layer.MapServer("Base",

http://dvfmweb2/mapserver/mapserv.exe?map=E:/RCIS/Web/Mapfiles/MappingBase.map&",

{ layers: 'Base', exceptions: "application/vnd.ogc.se_xml" },

{ isBaseLayer: true, opacity: 0.9 },

{ tileSize: new OpenLayers.Size(256, 256), buffer: 1 });


map.addLayers([msBase])







...MapFile looks like this



MAP

  IMAGETYPE      PNG24

  CONFIG "PROJ_LIB" "E:/RCIS/Web/MapServerDlls/projlib/"

  EXTENT         -180 -90 180 90

  SIZE           256 256

  FONTSET "E:/RCIS/Web/MapServerDlls/content/fontset.txt"

  IMAGECOLOR     255 255 255

  TRANSPARENT ON

  PROJECTION

     AUTO

  END

         LAYER

                 GROUP "Base"

                 NAME "WaterLn"

                 TYPE LINE

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .02

                 CONNECTION "server=Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),FULLNAME from NATIONALDB.sde.Water_ln_vw USING UNIQUE WATER_LN_ID USING SRID=4269"

                 LABELITEM    "FULLNAME"

                 CLASS

                          STYLE

                           COLOR 000 102 204

                           OUTLINECOLOR 102 178 255

                           WIDTH 2

                          END

                           LABEL

                                   COLOR 000 153 000

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS FALSE

                                   MINDISTANCE 2000

                                   MINSCALEDENOM 20.00



                          END

                 END

         PROJECTION

                  AUTO

         END

         END

         LAYER

                 GROUP "Base"

                 NAME "Water"

                 TYPE POLYGON

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),FULLNAME from NATIONALDB.sde.Water_vw USING UNIQUE WATER_ID USING SRID=4269"

                 LABELITEM    "FULLNAME"

                 CLASS

                          STYLE

                           COLOR 000 102 204

                           OUTLINECOLOR 102 178 255

                           WIDTH 2

                          END

                           LABEL

                                   COLOR 000 153 000

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS FALSE

                                   MINDISTANCE 2000

                                   MINSCALEDENOM 20.00



                          END

                 END

         PROJECTION

                  AUTO

         END



END

                 LAYER

                 GROUP "Base"

                 NAME "ZipCode"

                 TYPE POLYGON

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .12

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),ZIPCODE from NATIONALDB.sde.ZIPCODES USING INDEX ZIPCODES_SIDX USING UNIQUE ZIPCODES_ID USING SRID=4269"

                 LABELITEM    "ZIPCODE"

                 CLASS

                          STYLE

                           OUTLINECOLOR 0 0 0

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 132 31 31

                                   OUTLINECOLOR 255 255 255

                                   OUTLINEWIDTH 3

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   #ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS TRUE

                                   #MINDISTANCE 600

                                   #BUFFER 15

                          END

                 END

         PROJECTION

                  AUTO

         END

         END

                 LAYER

                 GROUP "Base"

                 NAME "Counties"

                 TYPE POLYGON

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .50

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),CNTY_NAME_UC from NATIONALDB.sde.COUNTY USING INDEX S15_idx USING UNIQUE COUNTY_ID USING SRID=4269"

                 LABELITEM    "CNTY_NAME_UC"

                 CLASS

                          STYLE

                           OUTLINECOLOR 051 025 000

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 051 025 000

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   ANTIALIAS TRUE

                                   POSITION AUTO

                                   PARTIALS FALSE

                                   #MINDISTANCE 600

                                   #BUFFER 15

                          END

                 END

         PROJECTION

                  AUTO

         END

         END

                 LAYER

                 GROUP "Base"

                 NAME "States"

                 TYPE POLYGON

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),ST_NAME_MC from NATIONALDB.sde.STATES USING INDEX S11_idx USING UNIQUE STATES_ID USING SRID=4269"

                 LABELITEM    "ST_NAME_MC"

                 CLASS

                          STYLE

                           OUTLINECOLOR 000 153 000

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 000 153 000

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS FALSE

                                   MINDISTANCE 2000

                                   MINSCALEDENOM 20.00



                          END

                 END

         PROJECTION

                  AUTO

         END

         END

                 LAYER

             GROUP "Base"

                 NAME "MajorRoads"

                 TYPE LINE

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .30

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),FULLNAME from NATIONALDB.sde.Major_Roads_vw USING UNIQUE MJR_ROADS_ID USING SRID=4269"

                 LABELITEM    "FULLNAME"

                 CLASS

                          STYLE

                           OUTLINECOLOR 000 000 000

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 255 000 000

                                   OUTLINECOLOR 255 255 255

                                   OUTLINEWIDTH 3

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   MAXSIZE 8

                                   #REPEATDISTANCE 600

                                   MINDISTANCE 1000

                                   #ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS TRUE

                                   MINDISTANCE 600

                                   #BUFFER 15

                          END

                 END

         PROJECTION

                  AUTO

         END

         END

                 LAYER

                 GROUP "Base"

                 NAME "AllRoads"

                 TYPE LINE

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .04

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),FULLNAME from NATIONALDB.sde.All_Roads_vw USING UNIQUE ALL_ROADS_ID USING SRID=4269"

                 LABELITEM    "FULLNAME"

                 CLASS

                          STYLE

                           OUTLINECOLOR 000 000 000

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 255 000 000

                                   OUTLINECOLOR 255 255 255

                                   OUTLINEWIDTH 3

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   MAXSIZE 7

                                   ANGLE AUTO

                                   #REPEATDISTANCE 600

                                   MINDISTANCE 1000

                                   #ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS FALSE

                                   MINDISTANCE 600

                                   #BUFFER 15

                          END

                 END

         PROJECTION

                  AUTO

         END

         END

                 LAYER

                 GROUP "Base"

                 NAME "Highways"

                 TYPE LINE

                 STATUS ON

                 LABELCACHE ON

                 PROCESSING 'LABEL_NO_CLIP=1'

                 CONNECTIONTYPE PLUGIN

                 PLUGIN "msplugin_mssql2008.dll"

                 MAXGEOWIDTH .80

                 CONNECTION "server= Some SQL Connection;Initial Catalog=NATIONALDB;Integrated Security=False"

                 DATA "shape(geography),FULLNAME from NATIONALDB.sde.Highways_vw USING UNIQUE HWY_ID USING SRID=4269"

                 LABELITEM    "FULLNAME"

                 CLASS

                          STYLE

                           OUTLINECOLOR 000 000 000

                           WIDTH 3

                          END

                           LABEL

                                   COLOR 255 000 000

                                   OUTLINECOLOR 255 255 255

                                   OUTLINEWIDTH 3

                                   TYPE TRUETYPE

                                   FONT Arial

                                   SIZE 12

                                   SIZE 12

                                   #ANTIALIAS FALSE

                                   POSITION AUTO

                                   PARTIALS TRUE

                                   MINDISTANCE 600

                                   #BUFFER 15

                          END

                 END

         PROJECTION

                  AUTO

         END

         END

END











I'm not sure if this is the right way to do it for OL3 or if there is a better way?

Any help is greatly appreciated!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/mailman/private/ms4w-users/attachments/20160523/2c718948/attachment.html>


More information about the MS4W-Users mailing list