Skip to content

Commit

Permalink
0.0.96 geocoder with options
Browse files Browse the repository at this point in the history
  • Loading branch information
lstiz committed Dec 18, 2024
1 parent 7927be6 commit ac2191d
Show file tree
Hide file tree
Showing 10 changed files with 5,319 additions and 5,284 deletions.
10,001 changes: 5,009 additions & 4,992 deletions dist/index-DMlHD4NY.mjs → dist/index-NFWyDjBL.mjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { p as Ui } from "./index-DMlHD4NY.mjs";
import { p as Ui } from "./index-NFWyDjBL.mjs";
var Zt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function No(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
Expand Down
264 changes: 132 additions & 132 deletions dist/mapicgc-gl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mapicgc-gl.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { C as p, a as s, M as r } from "./index-DMlHD4NY.mjs";
import { C as p, a as s, M as r } from "./index-NFWyDjBL.mjs";
export {
p as CompareMaps,
s as Config,
Expand Down
264 changes: 132 additions & 132 deletions dist/mapicgc-gl.umd.js

Large diffs are not rendered by default.

Binary file modified docu_Map.md
Binary file not shown.
36 changes: 24 additions & 12 deletions package-lock.json

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

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mapicgc-gl-js",
"homepage": "https://openicgc.github.io/mapicgc-doc/",
"version": "0.0.95",
"version": "0.0.96",
"description": "mapicgc-gl-js library",
"author": "Institut Cartogràfic i Geològic de Catalunya",
"license": "BSD-3-Clause",
Expand Down Expand Up @@ -44,6 +44,7 @@
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@rollup/plugin-babel": "^6.0.4",
"axios": "^1.7.9",
"dotenv": "^16.3.1",
"jest": "29.7.0",
"jsdoc": "^4.0.2",
Expand All @@ -53,7 +54,8 @@
"rollup-plugin-polyfill": "^4.2.0",
"ssh2-sftp-client": "^9.0.4",
"vite": "^5.2.10",
"vite-plugin-node-polyfills": "^0.21.0"
"vite-plugin-node-polyfills": "^0.21.0",
"xml2js": "^0.6.2"
},
"dependencies": {
"@deck.gl/core": "~8.9.35",
Expand All @@ -63,10 +65,9 @@
"@maplibre/maplibre-gl-compare": "^0.5.0",
"@maplibre/maplibre-gl-geocoder": "^1.5.0",
"@watergis/maplibre-gl-export": "^3.7.0",
"axios": "^1.6.7",
"flatgeobuf": "^3.31.1",
"maplibre-gl": "^4.7.1",
"utm-latlng": "^1.0.8",
"xml2js": "^0.6.2"
"utm-latlng": "^1.0.8"

}
}
20 changes: 12 additions & 8 deletions src/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,29 @@ export default class Map {

}
/**
* Add geocoder.
* Add geocoder with customizable options.
* @function addGeocoderICGC
* @param {string} [position='top-right'] - Position to add the control on the map.
* @returns {Object} - The current position of the search result.
* @param {Object} [options={}] - Optional configuration options for the geocoder. Defaults to an empty object.
* @param {string} [position='top-right'] - Position to add the geocoder control on the map. Defaults to 'top-right'.
* @returns {Object} - The merged configuration options for the geocoder, including the position.
*
*/
addGeocoderICGC(position) {
addGeocoderICGC(options = {}, position = "top-right") {
try {
if (position === undefined) {
position = "top-right";
}
let options = {

const defOptions = {
collapsed: true,
marker: true,
zoom: 16,
popup: true,
showResultMarkers: true,
maplibregl: maplibregl,
showResultsWhileTyping: true,
minLength: 2,
};
options = { ...defOptions, ...options };


const geocoderApi = {
forwardGeocode: async (config) => {
const features = [];
Expand Down
3 changes: 2 additions & 1 deletion test/exemples/addGeocoderICGC.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
pitch: 0,
});
map.on("load", () => {
map.addGeocoderICGC();
let options = { zoom: 10 };
map.addGeocoderICGC(options);
});
}
initMap();
Expand Down

0 comments on commit ac2191d

Please sign in to comment.