I have a map converted from an SVG file, and now I want to add a marker on this map directly to the cursor position. But the marker is placed in the wrong position, and they do not follow any rules, so I can not properly control and change them.
From this example: http://jvectormap.com/examples/mall/ I know that we can place markers on the map by their coordinates, and not by the longitude and latitude of the map. But they are set during map initialization, while I want the marker to be dynamic every time I click.
And from this example: http://jvectormap.com/examples/reverse-projection/, we can place the marker directly at the cursor position, but the map requires inserts and projection (to convert e.offsetX and e.offsetY to lat, long), while my map is configured from an SVG file, so this data is missing.
So you can help me:
1. How to define inserts and projections for a custom map? (I use http://svgto.jvectormap.com/ to convert my SVG file, but it just returns the paths)
2. Without using the longitude and latitude of the map, how can I place the marker to the right at the cursor position?
Thank you very much.
source
share