Skip to content

Commit

Permalink
Add default null value
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 25, 2024
1 parent 0d70e42 commit 262c970
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
8 changes: 4 additions & 4 deletions maplibre/srcjs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 2 additions & 21 deletions srcjs/pymaplibregl.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
import mustache from "mustache";

// import { getCustomMapMethods } from "./mapmethods";
import { getTextFromFeature } from "./utils";

/*
function getTextFromFeature(feature, property, template) {
if (template !== null) {
return mustache.render(template, feature.properties);
}
if (property === null) {
const text = Object.keys(feature.properties)
.map((key) => `${key}: ${feature.properties[key]}`)
.join("</br>");
return text;
}
return feature.properties[property];
}
*/

export default class PyMapLibreGL {
constructor(mapOptions) {
this._id = mapOptions.container;
Expand Down Expand Up @@ -79,7 +60,7 @@ export default class PyMapLibreGL {
}
}

addPopup(layerId, property, template = null) {
addPopup(layerId, property = null, template = null) {
const popupOptions = {
closeButton: false,
};
Expand All @@ -92,7 +73,7 @@ export default class PyMapLibreGL {
});
}

addTooltip(layerId, property, template = null) {
addTooltip(layerId, property = null, template = null) {
const popupOptions = {
closeButton: false,
closeOnClick: false,
Expand Down

0 comments on commit 262c970

Please sign in to comment.