Package org.geoserver.wms.featureinfo

Examples of org.geoserver.wms.featureinfo.FeatureTemplate


        resp.setEntity(format.toRepresentation(buildContext(namespace, f)));
    }

    private Map buildContext(String namespace, SimpleFeature f) {
        Map m = new HashMap();
        FeatureTemplate t = new FeatureTemplate();
       
        m.put(
                "typeName",
                namespace 
                + ":"
                + f.getType().getName().getLocalPart()
             );

        m.put("kmllink", buildURL(GEOSERVER_BASE_URL, f.getIdentifier().toString() + "_goto.kml", null, URLType.SERVICE));
       
        m.put("rawkmllink",  buildURL(GEOSERVER_BASE_URL,  f.getIdentifier().toString() + ".kml?raw=true", null, URLType.SERVICE));
       
        try {
            m.put("name", t.title(f));
        } catch (IOException e) {
            m.put("name", f.getIdentifier().toString());
        }

        try {
            m.put("description", t.description(f));
        } catch (IOException e) {
            m.put("description", "");
        }

        return m;
View Full Code Here


public class FeatureTimeTemplate {

    FeatureTemplate delegate;
   
    public FeatureTimeTemplate() {
        this( new FeatureTemplate() );
    }
View Full Code Here

    static class PlacemarkDescriptionDecorator implements KmlDecorator {
        static final Logger LOGGER = Logging.getLogger(PlacemarkDescriptionDecorator.class);

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            FeatureTemplate template = context.getTemplate();
            SimpleFeature sf = context.getCurrentFeature();
            String description = null;
            try {
                description = template.description(sf);
            } catch (IOException e) {
                String msg = "Error occured processing 'description' template.";
                LOGGER.log(Level.WARNING, msg, e);
            }
View Full Code Here

TOP

Related Classes of org.geoserver.wms.featureinfo.FeatureTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.