Skip to content

Commit

Permalink
Fix stimulus init
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Jul 11, 2021
1 parent bc66318 commit b6c8151
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 4 additions & 5 deletions assets/dist/googlemaps_controller.js
Expand Up @@ -49,6 +49,8 @@ var _default = /*#__PURE__*/function (_Controller) {
var _this = this;

this._prepareApi(this.apiKeyValue).then(function () {
_this.element.style.height = _this.heightValue + 'px';

var options = _objectSpread(_objectSpread({}, _this.defaultOptions), {}, {
latitude: _this.latitudeValue,
longitude: _this.longitudeValue,
Expand Down Expand Up @@ -174,7 +176,7 @@ exports["default"] = _default;
longitude: Number,
zoom: Number,
height: Number,
title: Boolean,
title: String,
icon: String,
apiKey: String
});
Expand All @@ -184,8 +186,5 @@ exports["default"] = _default;
mapTypeControl: false,
scaleControl: false,
draggable: false,
scrollwheel: false,
title: false,
icon: false,
apiKey: ''
scrollwheel: false
});
3 changes: 2 additions & 1 deletion assets/dist/openstreetmap_controller.js
Expand Up @@ -96,7 +96,8 @@ var _default = /*#__PURE__*/function (_Controller) {
var marker = L.marker(position, markerOptions);

if (this.titleValue) {
marker.bindPopup(this.titleValue).openPopup();
var popup = L.popup().setContent(this.titleValue);
marker.bindPopup(popup).openPopup();
}

return marker;
Expand Down
7 changes: 3 additions & 4 deletions assets/src/googlemaps_controller.js
Expand Up @@ -8,7 +8,7 @@ export default class extends Controller {
longitude: Number,
zoom: Number,
height: Number,
title: Boolean,
title: String,
icon: String,
apiKey: String,
};
Expand All @@ -20,13 +20,12 @@ export default class extends Controller {
scaleControl: false,
draggable: false,
scrollwheel: false,
title: false,
icon: false,
apiKey: '',
};

connect() {
this._prepareApi(this.apiKeyValue).then(() => {
this.element.style.height = this.heightValue + 'px';

let options = {
...this.defaultOptions,
latitude: this.latitudeValue,
Expand Down
4 changes: 3 additions & 1 deletion assets/src/openstreetmap_controller.js
Expand Up @@ -55,7 +55,9 @@ export default class extends Controller {
const marker = L.marker(position, markerOptions);

if (this.titleValue) {
marker.bindPopup(this.titleValue).openPopup();
const popup = L.popup().setContent(this.titleValue);

marker.bindPopup(popup).openPopup();
}

return marker;
Expand Down

0 comments on commit b6c8151

Please sign in to comment.