T
T
TechNOIR2018-02-11 11:48:53
leaflet
TechNOIR, 2018-02-11 11:48:53

leaflet. How to fix the error in the search plugin?

Good afternoon.
I'm trying to connect the search plugin
according to the example
When I try to enter a value (which is 100% in the database) into the search query, I get no results and the browser inspector gets errors "layer.getBounds is not a function in leaflet-search.js"
You can see here
Me so I understand results do not go because of this error?
Please help with solving the problem. Thanks in advance!
GeoJSON data - ignn.ru/test/test.js

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2018-02-11
@freeExec

The plugin says that it works with version 1.1, and you have 1.3.
So try to screw up

loc = layer.getBounds().getCenter(); -> loc = layer.map.getBounds().getCenter();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question