Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://localhost/cgi-bin/mapserv.exe?LAYERS=testpoint&QUERY_LAYERS=testpoint&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=517948%2C157505%2C535448%2C170005&FEATURE_COUNT=1&HEIGHT=500&WIDTH=700&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A27700&X=357&Y=241&MAP=%2FWorkTemp%2Ftest.map
- layer = new OpenLayers.Layer.WMS( "WMS data","http://localhost/cgi-bin/mapserv.exe?", {layers: 'testpoint' , map: '/WorkTemp/test.map', transparent: true},{isBaseLayer: false, opacity: 1, singleTile: true, visibility: true});
- osMap.addLayer(layer);
- info = new OpenLayers.Control.WMSGetFeatureInfo({
- url: 'http://localhost/cgi-bin/mapserv.exe?',
- title: 'Identify features by clicking',
- queryVisible: true,
- maxFeatures: 1,
- vendorParams: {
- map: '/WorkTemp/test.map'
- } ,
- info_format: 'text/html',
- layers: [layer],
- eventListeners: {
- getfeatureinfo: function(event) {
- if(event.features.length > 0) {
- osMap.addPopup(new OpenLayers.Popup.FramedCloud(
- "chicken",
- osMap.getLonLatFromPixel(event.xy),
- null,
- event.text,
- null,
- true
- ));
- }
- }
- }
- });
- osMap.addControl(info);
- info.activate();
- LAYER
- NAME "testpoint"
- TYPE POINT
- STATUS ON
- CONNECTIONTYPE OGR
- CONNECTION "MYSQL:test,host=localhost,user=root,password=xxxxxx,port=3306"
- DATA "SELECT SHAPE,test from testpoint"
- DUMP TRUE
- TEMPLATE "c:WorkTemptest_template.html"
- LABELITEM "test"
- PROJECTION
- "init=epsg:27700"
- END
- CLASS
- NAME "test"
- STYLE
- SYMBOL 'circle'
- SIZE 10
- COLOR 255 215 0
- END
- LABEL
- COLOR 0 0 0
- FONT arial
- TYPE truetype
- SIZE 8
- POSITION AUTO
- PARTIALS FALSE
- OUTLINECOLOR 255 255 255
- END
- END
- END # layer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement