I am working with wms server edition and developing the code on visual studio 2010 edition to make use of my wms on a web client application.
I have some shapefiles like city buildings and rivers and I would like to render these features of interest on the map as an overlay. Then I need to add these as an overlay with openlayers onto my basemap. There are plenty of examples on doing this with openlayers. But, my question is that how I can create a map that only shows city building and sets the background as transparent. Since I am only interested in showing the city buildings rather than the whole world map. The image below is an example that I found from other brand map serving engine. So, I would like to get the same output as below where it shows only the buildings.
Hi, Thanks for the code Edgar. The code you have provided adjusts the bounding box according to the building shapefile. As a matter of fact, this was not my question. My question is that I want to be able to display only the buildings on the map with a trasnparent backgorund as shown in the screenshot that I have attached earlier. After getting the desired output, then I will use this map with openlayers to print it as an overlay on top of the thinkgeo map I created before.
If there is a special column to identify the corresponding building features, for instance, all the building features has a column “COLOR_MAP” which shares a unique value “7”, we can just show buildings using the code below:
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("");
ValueStyle valueStyle = new ValueStyle(); valueStyle.ColumnName = "COLOR_MAP";
I would like to set the background as transparent and only publish the building or city shapefile on a map that has an invisible background. Later, I will use this output to stack it onto thinkgeo map(this is the basemap) with openlayers. I know the deployment part-The code that involves adding wms in openlayers as an overlay. But my question is how to display the buildings like in the screenshot I have provided earlier where the background is invisible with building layer printed only.
In fact, I guess Edgar’s sample is correct, because our server returns the image with "png" format to client side after map refresh if you didn't do any changes here, the "png" image return from here is really with "transparent" background, if we use “Google Chrome” to run our “how do I sample”, then use “inspect element” function provided by “Google Chrome”, we will get the result image like the following: