chiragmo
Forum Replies Created
-
AuthorPosts
-
February 23, 2011 at 8:27 pm in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4157
chiragmoParticipantThanks, i just discovered this as well while trying to figure out how to change the color of the ocean in some of my maps from gray to it’s blue-ish shade. Also keep in mind for some of these maps…mostly all i believe, the default style is polygon..therefore when you want to create the labels for the countries, you will need to state the polygon symbolizer tag in your sld. The example above is for a point symbolizer…Here is an example to get the labels working with GEOSERVER and natural earth maps using the SLD(from geoserver’s SLD cookbook):
“
<?xml version=”1.0″ encoding=”ISO-8859-1″?>
<StyledLayerDescriptor version=”1.0.0″
xsi:schemaLocation=”http://www.opengis.net/sld StyledLayerDescriptor.xsd”
xmlns=”http://www.opengis.net/sld”
xmlns:ogc=”http://www.opengis.net/ogc”
xmlns:xlink=”http://www.w3.org/1999/xlink”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
<NamedLayer>
<Name>Polygon with default label</Name>
<UserStyle>
<Title>SLD Cook Book: Polygon with default label</Title>
<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Fill>
<CssParameter name=”fill”>#40FF40</CssParameter>
</Fill>
<Stroke>
<CssParameter name=”stroke”>#FFFFFF</CssParameter>
<CssParameter name=”stroke-width”>2</CssParameter>
</Stroke>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>name</ogc:PropertyName>
</Label>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
“
Also if you need to reference the data from these shape files and if your using OPENLAYERS, you can reference it through the getfeatureinfo method (which is a openlayers method).
February 16, 2011 at 12:11 am in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4154
chiragmoParticipantThanks, i’ll post what i find out as well.
February 15, 2011 at 11:08 pm in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4152
chiragmoParticipantI am on a similar issue myself…i got the same results with that map as well. Im using GeoServer also.
February 15, 2011 at 5:48 pm in reply to: Please help…need help on how to show country names on map… #4146
chiragmoParticipantThanks, you have pointed me in the right direction here. i been searching on google for examples of using the label function with openlayers and i keep coming across results that show it with a GML format rather than a WMS format which im using:
tiled2 = new OpenLayers.Layer.WMS(
“10m_admin_0_countries – Tiled”, “http://localhost:8080/geoserver/wms”,
{
layers: ‘named_polys:10m_admin_0_countries’,
width: ‘684’,
height: ‘330’,
srs: ‘EPSG:4326’,
format: “image/jpeg”,
tiled: ‘true’,
tilesOrigin : map.maxExtent.left + ‘,’ + map.maxExtent.bottom
},
{
buffer: 0,
displayOutsideMaxExtent: true
}
);
Any more suggestions are appreciated thanks.
-
AuthorPosts