New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@maptiler/geocoding-control

Package Overview
Dependencies
Maintainers
4
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maptiler/geocoding-control - npm Package Compare versions

Comparing version 0.0.43 to 0.0.44

6

dist/lib/maplibreglMapController.d.ts
import type MapLibreGL from "maplibre-gl";
import type { FitBoundsOptions, Map, FlyToOptions, FillLayerSpecification, LineLayerSpecification } from "maplibre-gl";
import type { MapController } from "./types";
export declare function createMaplibreglMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions, fullGeometryStyle?: {
fill: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
export declare function createMaplibreglMapController(map: Map, maplibregl?: typeof MapLibreGL | undefined, marker?: boolean | maplibregl.MarkerOptions, showResultMarkers?: boolean | maplibregl.MarkerOptions, flyToOptions?: FlyToOptions, fitBoundsOptions?: FitBoundsOptions, fullGeometryStyle?: undefined | {
fill?: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
line?: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
}): MapController;
{
"name": "@maptiler/geocoding-control",
"version": "0.0.43",
"version": "0.0.44",
"type": "module",

@@ -46,3 +46,3 @@ "author": {

"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.2.0",
"@sveltejs/vite-plugin-svelte": "^1.3.1",
"@tsconfig/svelte": "^3.0.0",

@@ -53,3 +53,3 @@ "@turf/buffer": "^6.5.0",

"@types/leaflet": "^1.9.0",
"prettier": "^2.7.1",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",

@@ -56,0 +56,0 @@ "svelte": "^3.53.1",

@@ -19,12 +19,11 @@ # MapTiler Geocoding control for MapLibre GL JS and Leaflet

import maplibregl from "maplibre-gl";
import { GeocodingControl } from "@maptiler/geocoding-control/maplibre";
import { GeocodingControl } from "@maptiler/geocoding-control/maplibregl";
import "@maptiler/geocoding-control/dist/style.css";
import "maplibre-gl/dist/maplibre-gl.css";
const API_KEY = "YOUR_MAPTILER_API_KEY_HERE";
const apiKey = "YOUR_MAPTILER_API_KEY_HERE";
const map = new maplibregl.Map({
container: "map", // id of HTML container element
style:
"https://api.maptiler.com/maps/streets/style.json?key=" +
YOUR_MAPTILER_API_KEY_HERE,
style: "https://api.maptiler.com/maps/streets/style.json?key=" + apiKey,
center: [16.3, 49.2],

@@ -34,6 +33,3 @@ zoom: 7,

const gc = new GeocodingControl({
apiKey: YOUR_MAPTILER_API_KEY_HERE,
maplibregl,
});
const gc = new GeocodingControl({ apiKey, maplibregl });

@@ -54,2 +50,4 @@ map.addControl(gc);

const apiKey = "YOUR_MAPTILER_API_KEY_HERE";
const map = L.map(document.getElementById("map")).setView([49.2, 16.3], 6);

@@ -60,4 +58,3 @@

L.tileLayer(
`https://api.maptiler.com/maps/streets/{z}/{x}/{y}${scale}.png?key=` +
YOUR_MAPTILER_API_KEY_HERE,
`https://api.maptiler.com/maps/streets/{z}/{x}/{y}${scale}.png?key=` + apiKey,
{

@@ -74,3 +71,3 @@ tileSize: 512,

L.control.maptilerGeocoding({ apiKey: YOUR_MAPTILER_API_KEY_HERE }).addTo(map);
L.control.maptilerGeocoding({ apiKey }).addTo(map);
```

@@ -77,0 +74,0 @@

@@ -36,6 +36,8 @@ import type MapLibreGL from "maplibre-gl";

fitBoundsOptions: FitBoundsOptions = {},
fullGeometryStyle: {
fill: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
line: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
} = {
fullGeometryStyle:
| undefined
| {
fill?: Pick<FillLayerSpecification, "layout" | "paint" | "filter">;
line?: Pick<LineLayerSpecification, "layout" | "paint" | "filter">;
} = {
fill: {

@@ -72,20 +74,26 @@ paint: {

function addFullGeometryLayer() {
map.addSource("full-geom", {
type: "geojson",
data: emptyGeojson,
});
if (fullGeometryStyle?.fill || fullGeometryStyle?.line) {
map.addSource("full-geom", {
type: "geojson",
data: emptyGeojson,
});
}
map.addLayer({
...fullGeometryStyle.fill,
id: "full-geom-fill",
type: "fill",
source: "full-geom",
});
if (fullGeometryStyle?.fill) {
map.addLayer({
...fullGeometryStyle?.fill,
id: "full-geom-fill",
type: "fill",
source: "full-geom",
});
}
map.addLayer({
...fullGeometryStyle.line,
id: "full-geom-line",
type: "line",
source: "full-geom",
});
if (fullGeometryStyle?.line) {
map.addLayer({
...fullGeometryStyle?.line,
id: "full-geom-line",
type: "line",
source: "full-geom",
});
}
}

@@ -255,25 +263,29 @@

markers.push(
(typeof marker === "object"
? new maplibregl.Marker(marker)
: createMarker()
)
.setLngLat(picked.center)
.addTo(map)
);
if (showResultMarkers) {
markers.push(
(typeof marker === "object"
? new maplibregl.Marker(marker)
: createMarker()
)
.setLngLat(picked.center)
.addTo(map)
);
}
}
for (const feature of markedFeatures ?? []) {
if (feature === picked) {
continue;
if (showResultMarkers) {
for (const feature of markedFeatures ?? []) {
if (feature === picked) {
continue;
}
markers.push(
(typeof showResultMarkers === "object"
? new maplibregl.Marker(showResultMarkers)
: createMarker()
)
.setLngLat(feature.center)
.addTo(map)
);
}
markers.push(
(typeof showResultMarkers === "object"
? new maplibregl.Marker(showResultMarkers)
: createMarker()
)
.setLngLat(feature.center)
.addTo(map)
);
}

@@ -280,0 +292,0 @@ },

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

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

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