Package slash.navigation.kml.binding20

Examples of slash.navigation.kml.binding20.LookAt


     * this.setAbstractView(lookAt); </code>
     *
     *
     */
    public LookAt createAndSetLookAt() {
        LookAt newValue = new LookAt();
        this.setAbstractView(newValue);
        return newValue;
    }
View Full Code Here


     * this.setAbstractView(lookAt); </code>
     *
     *
     */
    public LookAt createAndSetLookAt() {
        LookAt newValue = new LookAt();
        this.setAbstractView(newValue);
        return newValue;
    }
View Full Code Here

                .getHeading();
        final Double altitude = options.getAltitude() == null ? Double.valueOf(height) : options
                .getAltitude();

        // build the lookat
        LookAt lookAt = new LookAt();
        lookAt.setLongitude(midpoint[0]);
        lookAt.setLatitude(midpoint[1]);
        lookAt.setAltitude(altitude);
        lookAt.setRange(distance);
        lookAt.setTilt(tilt);
        lookAt.setHeading(heading);
        lookAt.setAltitudeMode(options.getAltitudeMode());

        return lookAt;
    }
View Full Code Here

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Document document = (Document) feature;
            Envelope bounds = context.getMapContent().getRenderingArea();
            LookAt lookAt = buildLookAt(bounds, context.getLookAtOptions(), false);
            document.setAbstractView(lookAt);

            return document;

        }
View Full Code Here

    class LayerLookAtDecorator implements KmlDecorator {

        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Envelope bounds = context.getCurrentLayer().getBounds();
            LookAt lookAt = buildLookAt(bounds, context.getLookAtOptions(), false);
            feature.setAbstractView(lookAt);

            return feature;
        }
View Full Code Here

            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

                } catch(Exception e) {
                    throw new ServiceException("Failed to transform the layer bounds for "
                            + layer.getTitle() + " to WGS84", e);
                }
            }
            LookAt la = lookAtFactory.buildLookAt(layerBounds, lookAtOptions, false);
            folder.setAbstractView(la);
        }

        encodeNetworkLinks(folder, layer, bounds, zoomLevel);
    }
View Full Code Here

        List<ReferencedEnvelope> layerBounds = new ArrayList<ReferencedEnvelope>(mapContent
                .layers().size());
        ReferencedEnvelope aggregatedBounds = computePerLayerQueryBounds(mapContent, layerBounds,
                null);
        if (aggregatedBounds != null) {
            LookAt la = lookAtFactory.buildLookAt(aggregatedBounds, lookAtOptions, false);
            container.setAbstractView(la);
        }

        final List<MapLayerInfo> layers = request.getLayers();
        final List<Style> styles = request.getStyles();
        for (int i = 0; i < layers.size(); i++) {
            MapLayerInfo layerInfo = layers.get(i);
            NetworkLink nl = container.createAndAddNetworkLink();
            nl.setName(layerInfo.getName());
            nl.setVisibility(true);
            nl.setOpen(true);

            // look at for this layer
            Envelope requestBox = context.getRequestBoxWGS84();
           
            if (requestBox != null) {
                LookAt la = lookAtFactory.buildLookAt(requestBox, lookAtOptions, false);
                nl.setAbstractView(la);
            }

            // set bbox to null so its not included in the request, google
            // earth will append it for us
View Full Code Here

public class KmlFormatIT {
    @Test
    public void testReader() throws FileNotFoundException, JAXBException {
        Reader reader = new FileReader(TEST_PATH + "from20.kml");
        Kml kml = (Kml) newUnmarshaller20().unmarshal(reader);
        assertNotNull(kml);
        assertNotNull(kml.getFolder());
        assertEquals(3, kml.getFolder().getDocumentOrFolderOrGroundOverlay().size());
    }
View Full Code Here

    }

    @Test
    public void testInputStream() throws FileNotFoundException, JAXBException {
        InputStream in = new FileInputStream(TEST_PATH + "from20.kml");
        Kml kml = (Kml) newUnmarshaller20().unmarshal(in);
        assertNotNull(kml);
        assertNotNull(kml.getFolder());
        assertEquals(3, kml.getFolder().getDocumentOrFolderOrGroundOverlay().size());
    }
View Full Code Here

TOP

Related Classes of slash.navigation.kml.binding20.LookAt

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.