Examples of Placemark


Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Placemark pm = (Placemark) feature;
            // while it's possible to have more than one style object, GE will only paint
            // the first one
            Style style = pm.createAndAddStyle();
            List<Symbolizer> symbolizers = context.getCurrentSymbolizers();
            SimpleFeature sf = context.getCurrentFeature();
            if (symbolizers.size() > 0 && sf.getDefaultGeometry() != null) {
                // sort by point, text, line and polygon
                Map<Class, List<Symbolizer>> classified = classifySymbolizers(symbolizers);
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

    static class PlacemarkSelfLinkDecorator extends AbstractGeoSearchDecorator {
        static final Logger LOGGER = Logging.getLogger(PlacemarkSelfLinkDecorator.class);

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Placemark pm = (Placemark) feature;
           
            String link = "";

            try {
                link = getFeatureTypeURL(context);
            } catch (IOException ioe) {
                throw new RuntimeException(ioe);
            }
            String[] id = context.getCurrentFeature().getID().split("\\.");

            link = link + "/" + id[1] + ".kml";

            Link al = pm.createAndSetAtomLink(link);
            al.setRel("self");
           
            return pm;
        }
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark


        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            SimpleFeature sf = context.getCurrentFeature();
            Placemark pm = (Placemark) feature;

            // create the extended data, and encode any non null, non geometric attribute
            ExtendedData exd = pm.createAndSetExtendedData();
            SchemaData schemaData = exd.createAndAddSchemaData();
            schemaData.setSchemaUrl("#" + context.getCurrentFeatureType().getTypeName() + "_" + context.getCurrentLayerIndex());
            for (AttributeDescriptor ad : sf.getFeatureType().getAttributeDescriptors()) {
                // skip geometry attributes
                if (ad instanceof GeometryDescriptor) {
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

    class PlacemarkLookAtDecorator implements KmlDecorator {

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Placemark pm = (Placemark) feature;
            Geometry geometry = (Geometry) context.getCurrentFeature().getDefaultGeometry();
            Envelope bounds = null;
            if (geometry != null) {
                bounds = geometry.getEnvelopeInternal();
            }
            LookAt lookAt = buildLookAt(bounds, context.getLookAtOptions(), true);
            pm.setAbstractView(lookAt);

            return pm;
        }
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

            } catch (IOException e) {
                String msg = "Error occured processing 'description' template.";
                LOGGER.log(Level.WARNING, msg, e);
            }

            Placemark pm = (Placemark) feature;
            if (description != null) {
                pm.setDescription(description);
            }
            return pm;
        }
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

                    SimpleFeature sf = (SimpleFeature) fi.next();
                    featureRetrieved = true;
                    context.setCurrentFeature(sf);

                    // only create the basic placemark here, the rest is delegated to decorators
                    Placemark pm = new Placemark();
                    pm.setId(sf.getID());

                    // call onto the decorators
                    for (KmlDecorator callback : callbacks) {
                        pm = (Placemark) callback.decorate(pm, context);
                        if (pm == null) {
View Full Code Here

Examples of de.micromata.opengis.kml.v_2_2_0.Placemark

                        continue;
                    }
                    context.setCurrentSymbolizers(symbolizers);

                    // only create the basic placemark here, the rest is delegated to decorators
                    Placemark pm = new Placemark();
                    pm.setId(sf.getID());

                    // call onto the decorators
                    for (KmlDecorator callback : callbacks) {
                        pm = (Placemark) callback.decorate(pm, context);
                        if (pm == null) {
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

     */
    public List<Placemark> getPlacemarksAsList() {
        List<Placemark> list = new LinkedList();
        Set<String> nameSet = getPlacemarkNames();
        for (String name : nameSet) {
            Placemark placemark = getPlacemark(name);
            list.add(placemark);
        }
        return list;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

    public void encode(Writer w) throws JAXBException {
        // Copy the contents of the Map of placemarks into the array.
        placemarks = new Placemark[placemarkMap.size()];
        int i = 0;
        for (String name : placemarkMap.keySet()) {
            Placemark placemark = placemarkMap.get(name);
            placemarks[i] = placemark;
            i++;
        }

        // Marshall the PlacemarkList class into XML
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

    @Override
    public void handleMessage(Message message) {
        // If we received a message that there is a new Placemark, then inform
        // all of the listeners.
        if (message instanceof PlacemarkNewMessage) {
            Placemark placemark = ((PlacemarkNewMessage)message).getPlacemark();
            synchronized (listeners) {
                for (PlacemarkConfigListener listener : listeners) {
                    listener.placemarkAdded(placemark);
                }
            }
            return;
        }

        // If we received a message that a placemark has been removed, then tell
        // all of the listeners.
        if (message instanceof PlacemarkRemoveMessage) {
            Placemark placemark = ((PlacemarkRemoveMessage) message).getPlacemark();
            synchronized (listeners) {
                for (PlacemarkConfigListener listener : listeners) {
                    listener.placemarkRemoved(placemark);
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.