@eturnity/eturnity_3d 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -0,0 +1 @@
1
+ VUE_APP_GOOGLE_MAP_API_KEY=AIzaSyAxqgQ_iRKAQ6AMvZ0a6Z0vkBwYTM-pnHM
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {
7
7
  "dev": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint",
@@ -60,7 +60,21 @@ export default {
60
60
  this.three_map.position.set(-coords.x*coef,-coords.y*coef,0)
61
61
  this.scene.add(this.three_map)
62
62
  }else{
63
-
63
+ let apiKey=process.env.VUE_APP_GOOGLE_MAP_API_KEY
64
+ console.log('apiKey Google',apiKey)
65
+ let backgroundPlanes=[]
66
+
67
+ let planeGeometry = new THREE.PlaneGeometry(1000, 1000)
68
+
69
+ let googleBackgroundUrl_0=`https://maps.googleapis.com/maps/api/staticmap?center=${this.layoutSettings.layout_latitude+","+this.layoutSettings.layout_longitude}&zoom=14&size=400x400&key=${apiKey}`
70
+ let texture = this.loader.load(googleBackgroundUrl_0)
71
+ let planeMaterial = new THREE.MeshBasicMaterial( {
72
+ map: texture,
73
+ side: THREE.DoubleSide
74
+ })
75
+ backgroundPlanes[0] = new THREE.Mesh(planeGeometry, planeMaterial)
76
+ backgroundPlanes[0] .position.z=0
77
+ this.background_map.add( backgroundPlanes[0] )
64
78
  }
65
79
  this.scene.add(this.background_map)
66
80
  },