![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
ol-street-view
Advanced tools
Street View implementation for Open Layers.
Tested with OpenLayers version 5, 6 and 7. For Ol5, you must set a custom "target" to prevent the control from being rendered at the default target ("ol-overlaycontainer-stopevent"), because that messes up the events and breaks the control.
If you are going to use this module, read the Google Terms of Service
// Default options
var opt_options = {
apiKey: null, // Must be provided to remove "For development purposes only" message
language: 'en',
i18n: {...}, // Custom translations. Default is according to selected language
size: 'md',
resizable: true,
sizeToggler: true,
defaultMapSize: 'expanded',
autoLoadGoogleMaps: true,
target: 'map' // Important for OL 5
}
var streetView = new StreetView(opt_options);
map.addControl(streetView);
Load ol-street-view.js
after OpenLayers and interactjs. StreetView is available as StreetView
.
<script src="https://unpkg.com/ol-street-view@2.0.5"></script>
<link rel="stylesheet" href="https://unpkg.com/ol-street-view@2.0.5/dist/css/ol-street-view.min.css" />
NPM package: ol-street-view.
Install the package via npm
npm install ol-street-view
import StreetView from 'ol-street-view';
import 'ol-street-view/lib/style/css/ol-street-view.css';
//or
import 'ol-street-view/lib/style/scss/ol-street-view.scss';
TypeScript types are shipped with the project in the dist directory and should be automatically used in a TypeScript project. Interfaces are provided for the Options.
Extends ol/control/Control~Control
Street View implementation for Open Layers.
opt_options
Options? StreetView options, see StreetView Options for more details.Call this function after the Google Maps library is loaded if autoLoadGoogleMaps is false
.
Otherwise it will called automatically after the Maps Library is loaded.
Returns void
This is useful if wou wanna add a custom icon on the panorama instance, add custom listeners, etc
Returns google.maps.StreetViewPanorama
Get the Vector Layer in wich the Pegman is displayer
Returns VectorLayer<VectorSource>
Get the background Raster layer that display the existing zones with Street View available
Returns TileLayer<XYZ>
Show Street View mode
coords
Coordinate Must be in the map projection formatReturns google.maps.StreetViewPanorama
Disables Street View mode
Returns void
[interface] - Custom Language
Exit Street View visualization label
Type: string
Exit Street View visualization title label
Type: string
Pegman icon title label on mouse hovering
Type: string
No images information
Type: string
Terms of Service
Type: string
Expand map
Type: string
Minimize Map
Type: string
Street View Event Types
Type: (SVEventTypes.LOAD_LIB | SVEventTypes.STREET_VIEW_EXIT | SVEventTypes.STREET_VIEW_INIT)
[interface] - StreetView Options specified when creating an instance
Default values:
{
apiKey: null,
size: 'lg',
zoomOnInit: 18,
resizable: true,
sizeToggler: true,
defaultMapSize: 'expanded',
autoLoadGoogleMaps: true,
language: 'en',
i18n: {...} // Translations according to selected language
}
Google Maps Api Key If not provided, the map will be in inverted colors with the message "For development purposes only"
Type: string
Size of the Pegman Control in the map
Type: ("sm"
| "md"
| "lg"
)
Zoom level on the map when init the Panorama
Type: number
To display a handler that enable dragging changing the height of the layout
Type: boolean
Control displayed once Street View is activated, to allow compact/expand the size of the map
Type: boolean
Default size of the map when the Street View is activated
Type: ("expanded"
| "compact"
| "hidden"
)
To configure if the Google Maps Library should be called automatically.
false
if you are going to load it on your own. If so, you must run the init
method AFTER the library is loaded. In this case the event 'loadLib' will not be fired.
Type: boolean
Specify a target if you want the control to be rendered outside of the map's viewport. For Ol5, you must set a target to prevent the control from being rendered at the default target ("ol-overlaycontainer-stopevent"), otherwise the control will not work.
Type: (HTMLElement | string)
Language support
Type: ("es"
| "en"
)
Add custom translations
Type: i18n
v2.0.5
ol-control
class to primary buttonFAQs
Street View implementation for Open Layers
The npm package ol-street-view receives a total of 222 weekly downloads. As such, ol-street-view popularity was classified as not popular.
We found that ol-street-view demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.