Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

venus-map

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

venus-map - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "venus-map",
"version": "1.0.3",
"version": "1.0.4",
"description": "tq-fed-map",

@@ -5,0 +5,0 @@ "main": "./build/index.js",

@@ -37,15 +37,5 @@ import OlMap from 'ol/Map'

})
if (window && window.MutationObserver) {
const wrapper = document.getElementById(id)
const observer = new MutationObserver(() => {
const { width, height } = wrapper.getBoundingClientRect()
this.instance.updateSize(width, height)
this.emit('update-size')
})
observer.observe(wrapper, {
attributes: true,
attributeFilter: ['style'],
attributeOldValue: true,
})
}
this._autoSize(id)
this.instance.getControls().forEach(c => this.instance.removeControl(c))

@@ -63,2 +53,30 @@ this.instance.appKey = appKey

_autoSize(id) {
const wrapper = document.getElementById(id)
const objDom = document.createElement('object')
const _handleObjectLoad = () => {
objDom.contentDocument.defaultView.addEventListener('resize', () => {
const { width, height } = wrapper.getBoundingClientRect()
this.instance.updateSize([width, height])
})
}
objDom.style.cssText = `
display: block;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
overflow: hidden;
opacity: 0;
pointer-events: none;
z-index: -1;
`
objDom.onload = _handleObjectLoad
objDom.type = 'text/html'
objDom.data = 'about:blank'
wrapper.appendChild(objDom)
}
add(some) {

@@ -65,0 +83,0 @@ some.setMap(this)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc