Change OpenLayers.Control.ScaleLine()

المشرف العام

Administrator
طاقم الإدارة
I have mapfile

MAP NAME "MapChiTieuDau" EXTENT 779275 2222000 788430 2233835 SIZE 800 800 UNITS meters STATUS ON IMAGETYPE png SHAPEPATH "/ms4w/apps/openlayers-3.8.2/DuLieuBachLongVy/Maps" IMAGECOLOR 190 232 255 FONTSET "/ms4w/apps/tutorial/fonts/fonts.list" WEB IMAGEPATH "/ms4w/tmp/" IMAGEURL "/ms_tmp/" METADATA "wms_title" "WMS Demo Server" "wms_onlineresource" "/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/Test/wms/BD_ChiTietDau.map" "wms_srs" "EPSG:4326" "wms_enable_request" "*" END #end METADATA END #end web PROJECTION "init=EPSG:4326" END SYMBOL NAME "circlef" TYPE ellipse FILLED true POINTS 10 10 END # POINTS END # SYMBOL LAYER NAME "binh_do_15" DATA binh_do_15 STATUS ON TYPE LINE CLASSITEM "SOURCE" LABELITEM "SOURCE" DEBUG on PROJECTION "init=EPSG:4326" END METADATA "wms_title" "binh_do_15" END CLASS NAME "binh_do_15" STYLE COLOR 174 213 252 END LABEL COLOR 183 68 85 TYPE TRUETYPE FONT arial SIZE 12 ANTIALIAS TRUE POSITION CL PARTIALS FALSE MINDISTANCE 300 BUFFER 4 STYLE # since to version 6 GEOMTRANSFORM 'labelpoly' OFFSET 2 2 END # STYLE END # end of label END END LAYER NAME "chitieu_mt" TYPE POINT DUMP true PROJECTION "init=EPSG:4326" END METADATA "wms_title" "chitieu_mt" END DEBUG on STATUS on DATA chitieu_mt CLASSITEM "Dau" LABELITEM "Dau" CLASS Name "chitieu_mt" STYLE SYMBOL "circlef" SIZE 16 COLOR 212 3 255 END TEXT (tostring([Dau],"%.2f")) END # end of CLASS END # end of LAYER END and have code javascript

var map, layer; var infoControls; var fromProjection = new OpenLayers.Projection('EPSG:4326'); var ll, popupClass, popupContentHTML; function init(){ format = 'image/png'; var bounds = new OpenLayers.Bounds(779275, 2222000, 788430, 2233835 ); map = new OpenLayers.Map('map', { controls:[ new OpenLayers.Control.Navigation(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Attribution(), new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.LayerSwitcher({'ascending':false}), //new OpenLayers.Control.ScaleLine(), new OpenLayers.Control.MousePosition(), new OpenLayers.Control.OverviewMap(), new OpenLayers.Control.KeyboardDefaults() ], numZoomLevels:7, maxExtent : bounds, //maxResolution: 3457.03125, //maxResolution : 0.0010217594533836, //projection : map.displayProjection, units : 'degrees' }); var bdhw = new OpenLayers.Layer.WMS( 'MapChiTieuDau','/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/Test/wms/BD_ChiTietDau.map', { layers: 'chitieu_mt', //srs: 'EPSG:4326', transparent: true //format: format// 'image/gif' }, { isBaseLayer: false, singleTile: true // projection: "EPSG:102113", }); var bdhw2 = new OpenLayers.Layer.WMS( 'MapChiTieuDau2','/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/Test/wms/BD_ChiTietDau.map', { layers: 'binh_do_15', //srs: 'EPSG:4326', transparent: true //format: format//'image/gif' }, { isBaseLayer: true, singleTile: true }); map.addLayers([bdhw,bdhw2]); map.zoomToExtent(bounds); var vectorLayer = new OpenLayers.Layer.Vector("Overlay"); var product= ; for( var i=0;i
 
أعلى