Answer the question
In order to leave comments, you need to log in
How to change the marker preset that appears when searching in Yandex Map?
Hello comrades! Please help me figure it out.
I use the search widget SearchControl Yandex maps. By default, it uses a blue marker for the found location. Is it possible to replace it with another preset? For example, would you like to replace it with 'islands#blueRunIcon'
?
const searchControl = new ymaps.control.SearchControl({
options: {
float: 'right',
noPlacemark: false,
},
});
self.map = new ymaps.Map(
"yandex-map",
{
center: [
48.583213,
66.017493,
],
zoom: 5,
controls: [
searchControl,
'fullscreenControl',
],
searchControlProvider: 'yandex#search',
},
{
restrictMapArea: true,
suppressMapOpenBlock: true,
},
);
Answer the question
In order to leave comments, you need to log in
I took a quick look, something like this:
- turn off the marker in the search
- catch the event of a successful search (load like)
- put your marker
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question