chiragmo

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4157

    chiragmo
    Participant

    Thanks, 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&#8221;

    xmlns:ogc=”http://www.opengis.net/ogc&#8221;

    xmlns:xlink=”http://www.w3.org/1999/xlink&#8221;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;

    <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).

    in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4154

    chiragmo
    Participant

    Thanks, i’ll post what i find out as well.

    in reply to: Using Natural Earth Cultural and Physical Data in Geoserver #4152

    chiragmo
    Participant

    I am on a similar issue myself…i got the same results with that map as well. Im using GeoServer also.

    in reply to: Please help…need help on how to show country names on map… #4146

    chiragmo
    Participant

    Thanks, 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&#8221;,

    {

    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.

Viewing 4 posts - 1 through 4 (of 4 total)