Topic: Setting markers on Vector maps

myronblake86 free asked 2 years ago


Hi! I use mdb vector maps and trying to set markers. How to convert latitude and longitude into x, y ?


myronblake86 free commented 2 years ago

1 latlng works only with $('#map').vectorMap({.... using jQuery

2 But only x y works with new VectorMap (JS as in examples not jQuery) const map = document.getElementById('map-with-bullets'); const mapInstance = new VectorMap(map, {

I want to use VectorMap function with latlng, but how?


Marcin Luczak staff answered 2 years ago


Hi,

VectorMap works with canvas coordinates relative to the map's SVG element. As you could use a variety of maps it is not possible to use latitude and longitude coordinates and use them inside the VectorMap. You should use x and y coordinates instead.

For creating bullets/markers for jquery VectorMaps please see Events documentation

Keep coding, Marcin



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: MDB4 4.19.2
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No