Beispiel #1
0
    def __init__(self,
                 url=None,
                 fileExtension=None,
                 rectangle=None,
                 tillingScheme=None,
                 ellipsoid=None,
                 tileWidth=None,
                 tileHeight=None,
                 tileDiscardPolicy=None,
                 minimumLevel=None,
                 maximumLevel=None,
                 credit=None,
                 proxy=None,
                 subdomains=None):

        self.url = url
        self.fileExtension = fileExtension
        self.rectangle = rectangle

        self.tillingScheme = com.notimplemented(tillingScheme)
        self.ellipsoid = com.notimplemented(ellipsoid)

        self.tileWidth = tileWidth
        self.tileHeight = tileHeight
        self.tileDiscardPolicy = com.notimplemented(tileDiscardPolicy)

        self.minimumLevel = minimumLevel
        self.maximumLevel = maximumLevel

        self.credit = credit

        self.proxy = com.notimplemented(proxy)
        self.subdomains = com.notimplemented(subdomains)
Beispiel #2
0
 def __init__(self,
              url=None,
              proxy=None,
              tilingScheme=None,
              ellipsoid=None,
              credit=None):
     self.url = url
     self.proxy = com.notimplemented(proxy)
     self.tilingScheme = com.notimplemented(tilingScheme)
     self.ellipsoid = com.notimplemented(ellipsoid)
     self.credit = credit
Beispiel #3
0
    def __init__(self,
                 url,
                 modelMatrix,
                 basePath=None,
                 show=None,
                 scale=None,
                 minimumPixelSize=None,
                 maximumScale=None,
                 id=None,
                 allowPicking=None,
                 incrementallyLoadTextures=None,
                 asynchronous=None,
                 debugShowBoundingVolume=None,
                 debugWireframe=None):

        self.url = url

        self.modelMatrix = Transforms.eastNorthUpToFixedFrame(modelMatrix)

        self.basePath = basePath
        self.show = show
        self.scale = scale
        self.minimumPixelSize = minimumPixelSize
        self.maximumScale = maximumScale
        self.id = com.notimplemented(id)
        self.allowPicking = allowPicking
        self.incrementallyLoadTextures = incrementallyLoadTextures
        self.asynchronous = asynchronous
        self.debugShowBoundingVolume = debugShowBoundingVolume
        self.debugWireframe = debugWireframe
Beispiel #4
0
    def __init__(self,
                 url,
                 layers,
                 parameters=None,
                 getFeatureInfoParameters=None,
                 enablePickFeatures=None,
                 getFeatureInfoFormats=None,
                 rectangle=None,
                 tillingScheme=None,
                 ellipsoid=None,
                 tileWidth=None,
                 tileHeight=None,
                 tileDiscardPolicy=None,
                 minimumLevel=None,
                 maximumLevel=None,
                 credit=None,
                 proxy=None,
                 subdomains=None):

        super(WebMapServiceImageryProvider,
              self).__init__(url=url,
                             rectangle=rectangle,
                             tillingScheme=tillingScheme,
                             ellipsoid=ellipsoid,
                             tileWidth=tileWidth,
                             tileHeight=tileHeight,
                             tileDiscardPolicy=tileDiscardPolicy,
                             minimumLevel=minimumLevel,
                             maximumLevel=maximumLevel,
                             credit=credit,
                             proxy=proxy,
                             subdomains=subdomains)

        self.layers = layers

        self.parameters = com.notimplemented(parameters)
        self.getFeatureInfoParameters = com.notimplemented(
            getFeatureInfoParameters)

        self.enablePickFeatures = enablePickFeatures

        self.getFeatureInfoFormats = com.notimplemented(getFeatureInfoFormats)
Beispiel #5
0
    def flyTo(self, destination, orientation=None):
        from cesiumpy.entities.entity import _CesiumEntity
        import cesiumpy.extension.geocode as geocode

        if isinstance(destination, _CesiumEntity):
            # if entity has a position (not positions), use it
            if destination.position is not None:
                destination = destination.position

        destination = geocode._maybe_geocode(destination, height=100000)

        if com.is_listlike(destination) and len(destination) == 4:
            destination = cartesian.Rectangle.maybe(destination)
        else:
            destination = cartesian.Cartesian3.maybe(destination, degrees=True)
        self.destination = destination
        self.orientation = com.notimplemented(orientation)

        return self
Beispiel #6
0
    def __init__(self,
                 sourceUri,
                 describe=None,
                 markerSize=None,
                 markerSymbol=None,
                 markerColor=None,
                 stroke=None,
                 strokeWidth=None,
                 fill=None):
        super(GeoJsonDataSource, self).__init__(sourceUri=sourceUri)

        self.describe = com.notimplemented(describe)

        self.markerSize = markerSize
        self.markerSymbol = markerSymbol
        self.markerColor = markerColor
        self.stroke = stroke
        self.strokeWidth = strokeWidth
        self.fill = fill
Beispiel #7
0
    def __init__(self,
                 url,
                 layer,
                 style,
                 format=None,
                 tileMatrixSetID=None,
                 tileMatrixLabels=None,
                 rectangle=None,
                 tillingScheme=None,
                 ellipsoid=None,
                 tileWidth=None,
                 tileHeight=None,
                 tileDiscardPolicy=None,
                 minimumLevel=None,
                 maximumLevel=None,
                 credit=None,
                 proxy=None,
                 subdomains=None):

        super(WebMapTileServiceImageryProvider,
              self).__init__(url=url,
                             rectangle=rectangle,
                             tillingScheme=tillingScheme,
                             ellipsoid=ellipsoid,
                             tileWidth=tileWidth,
                             tileHeight=tileHeight,
                             tileDiscardPolicy=tileDiscardPolicy,
                             minimumLevel=minimumLevel,
                             maximumLevel=maximumLevel,
                             credit=credit,
                             proxy=proxy,
                             subdomains=subdomains)
        self.layer = layer
        self.style = style
        self.format = format
        self.tileMatrixSetID = tileMatrixSetID

        self.tileMatrixLabels = com.notimplemented(tileMatrixLabels)
Beispiel #8
0
    def __init__(self,
                 divid=None,
                 width='100%',
                 height='100%',
                 animation=None,
                 baseLayerPicker=None,
                 fullscreenButton=None,
                 geocoder=None,
                 homeButton=None,
                 infoBox=None,
                 sceneModePicker=None,
                 selectionIndicator=None,
                 timeline=None,
                 navigationHelpButton=None,
                 navigationInstructionsInitiallyVisible=None,
                 scene3DOnly=None,
                 clock=None,
                 selectedImageryProviderViewModel=None,
                 imageryProviderViewModels=None,
                 selectedTerrainProviderViewModel=None,
                 terrainProviderViewModels=None,
                 imageryProvider=None,
                 terrainProvider=None,
                 skyBox=None,
                 skyAtmosphere=None,
                 fullscreenElement=None,
                 useDefaultRenderLoop=None,
                 targetFrameRate=None,
                 showRenderLoopErrors=None,
                 automaticallyTrackDataSourceClocks=None,
                 contextOptions=None,
                 sceneMode=None,
                 mapProjection=None,
                 globe=None,
                 orderIndependentTranslucency=None,
                 creditContainer=None,
                 dataSources=None,
                 terrainExaggeration=None):

        super(Viewer, self).__init__(
            divid=divid,
            width=width,
            height=height,
            scene3DOnly=scene3DOnly,
            clock=clock,
            imageryProvider=imageryProvider,
            terrainProvider=terrainProvider,
            skyBox=skyBox,
            skyAtmosphere=skyAtmosphere,
            sceneMode=sceneMode,
            orderIndependentTranslucency=orderIndependentTranslucency,
            mapProjection=mapProjection,
            globe=globe,
            useDefaultRenderLoop=useDefaultRenderLoop,
            targetFrameRate=targetFrameRate,
            showRenderLoopErrors=showRenderLoopErrors,
            contextOptions=contextOptions,
            creditContainer=creditContainer,
            terrainExaggeration=terrainExaggeration)

        self.animation = animation

        if self.imageryProvider is not None or self.terrainProvider is not None:
            # disable baseLayerPicker explicitly when any provider is specified
            if baseLayerPicker is None:
                baseLayerPicker = False

        self.baseLayerPicker = baseLayerPicker
        self.fullscreenButton = fullscreenButton
        self.geocoder = geocoder
        self.homeButton = homeButton
        self.infoBox = infoBox
        self.sceneModePicker = sceneModePicker
        self.selectionIndicator = selectionIndicator
        self.timeline = timeline
        self.navigationHelpButton = navigationHelpButton
        self.navigationInstructionsInitiallyVisible = navigationInstructionsInitiallyVisible

        self.selectedImageryProviderViewModel = com.notimplemented(
            selectedImageryProviderViewModel)
        self.imageryProviderViewModels = com.notimplemented(
            imageryProviderViewModels)
        self.selectedTerrainProviderViewModel = com.notimplemented(
            selectedTerrainProviderViewModel)
        self.terrainProviderViewModels = com.notimplemented(
            terrainProviderViewModels)
        self.fullscreenElement = com.notimplemented(fullscreenElement)

        self.automaticallyTrackDataSourceClocks = automaticallyTrackDataSourceClocks

        # ToDo: API to disable all flags to False

        if dataSources is not None:
            dataSources = com.validate_listlike(dataSources, key='dataSources')
            for ds in dataSources:
                self._dataSources.add(ds)
Beispiel #9
0
 def __init__(self, image, repeat=None):
     if isinstance(image, TemporaryImage):
         image = image.script
     self.image = image
     self.repeat = com.notimplemented(repeat)
Beispiel #10
0
    def __init__(self,
                 divid=None,
                 width='100%',
                 height='100%',
                 clock=None,
                 imageryProvider=None,
                 terrainProvider=None,
                 skyBox=None,
                 skyAtmosphere=None,
                 sceneMode=None,
                 scene3DOnly=None,
                 orderIndependentTranslucency=None,
                 mapProjection=None,
                 globe=None,
                 useDefaultRenderLoop=None,
                 targetFrameRate=None,
                 showRenderLoopErrors=None,
                 contextOptions=None,
                 creditContainer=None,
                 terrainExaggeration=None):

        self.div = _DIV(divid=divid, width=width, height=height)

        self.clock = com.notimplemented(clock)

        self.imageryProvider = imageryProvider
        self.terrainProvider = terrainProvider

        self.skyBox = com.notimplemented(skyBox)
        self.skyAtmosphere = com.notimplemented(skyAtmosphere)
        self.sceneMode = com.notimplemented(sceneMode)

        self.scene3DOnly = scene3DOnly
        self.orderIndependentTranslucency = orderIndependentTranslucency

        self.mapProjection = com.notimplemented(mapProjection)
        self.globe = com.notimplemented(globe)

        self.useDefaultRenderLoop = useDefaultRenderLoop
        self.targetFrameRate = targetFrameRate
        self.showRenderLoopErrors = showRenderLoopErrors

        self.contextOptions = com.notimplemented(contextOptions)
        self.creditContainer = com.notimplemented(creditContainer)

        self.terrainExaggeration = terrainExaggeration

        from cesiumpy.camera import Camera
        self._camera = Camera(self)

        from cesiumpy.scene import Scene
        self._scene = Scene(self)

        from cesiumpy.entities.entity import _CesiumEntity
        self._entities = RistrictedList(self,
                                        allowed=_CesiumEntity,
                                        propertyname='entities')
        from cesiumpy.datasource import DataSource
        self._dataSources = RistrictedList(self,
                                           allowed=DataSource,
                                           propertyname='dataSources')

        self._scripts = RistrictedList(self,
                                       allowed=six.string_types,
                                       propertyname='script')