Answer the question
In order to leave comments, you need to log in
How to add Placemark to yandexmapkit using vector drawable as image resource?
Good afternoon everyone, I'm using yandex mapkit 3.0, I'm trying to add a vector drawable icon
mapView.getMap().getMapObjects().addPlacemark(new Point(geoPosition.getLatitude(), geoPosition.getLongitude()), ImageProvider.fromResource(this, R.drawable.ic_geolocation));
mapView.getMap().getMapObjects().addPlacemark(new Point(geoPosition.getLatitude(), geoPosition.getLongitude()), ImageProvider.fromResource(this, R.drawable.somePng));
Answer the question
In order to leave comments, you need to log in
If still relevant:
private fun drawMyLocationMark(it: MyLocation) {
val view = View(requireContext()).apply {
background = requireContext().getDrawable(R.drawable.ic_place_24px)
}
mapview.map.mapObjects.addPlacemark(
Point(it.latitude, it.longitude),
ViewProvider(view)
)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question