0

I am working on a highmaps map of the world project and would like to zoom into a marker when the user clicks. I achieved this functionality by using the event in series in the below manner:

events: {
    click: function () {
    zoomInMarker();
  }

},

In my click function I am calling a function that gets Europe's coordinates. the function is defined as below:

function zoomInMarker () {

    var chart = $('#container').highcharts();

    chart.xAxis[0].setExtremes(740, 1180, false);
    chart.yAxis[0].setExtremes(-1730, -1470, false);
    chart.redraw();
 }

this works but which ever marker on the map I click, obviously always zooms in the same place that is Europe. How do i alter the zoomInMarker function to get the coordinates of the marker that was clicked. like for example using point.position instead of actual values like (740, 1180).

user3672795
  • 133
  • 3
  • 9
  • you would know if you were to search "map marker" on google – user3672795 Aug 29 '14 at 08:53
  • Well what Highmaps functionality are you using to make a marker? – Halvor Holsten Strand Aug 29 '14 at 08:58
  • I am defining map marker as an array with x and y positions and as you can see in my questions I am using the setExtremes functionality to zoom to particular coordinates. I want these coordinates to correspond to the map marker position every time a user click a marker. – user3672795 Aug 29 '14 at 09:20

0 Answers0