How to make link that zooms map to certain point (extent) on map.
I am using these two coordinates:
XMin: 2667537.31 YMin: 7738182.67 XMax: 2701933.97 YMax: 7761113.78
XMin: 2392784.83 YMin: 7833439.08 XMax: 2409983.16 YMax: 7844904.64
Solved! Go to Solution.
Raimonds,
You need to assign an on event to those buttons, something like this:
on(dom.byId('riga'), 'click', function(){ map.setExtent(new Extent({"xmin": 2667537.31, "ymin": 7738182.67, "xmax": 2701933.97, "ymax": 7761113.78, "spatialReference": { "wkid": 3059}}), true); }); on(dom.byId('ventspils'), 'click', function(){ map.setExtent(new Extent({"xmin": 2392784.83, "ymin": 7833439.08, "xmax": 2409983.16, "ymax": 7844904.64, "spatialReference": { "wkid": 3059}}), true); });
Raimonds,
You need to assign an on event to those buttons, something like this:
on(dom.byId('riga'), 'click', function(){ map.setExtent(new Extent({"xmin": 2667537.31, "ymin": 7738182.67, "xmax": 2701933.97, "ymax": 7761113.78, "spatialReference": { "wkid": 3059}}), true); }); on(dom.byId('ventspils'), 'click', function(){ map.setExtent(new Extent({"xmin": 2392784.83, "ymin": 7833439.08, "xmax": 2409983.16, "ymax": 7844904.64, "spatialReference": { "wkid": 3059}}), true); });
Raimonds,
Glad to help. Now it is your turn to help the community by marking this question as answered. All you have to do is click the "Correct Answer" link (the one with the little green star) on the post that provided the answer for you. If the answer was not provided by one of the responders then you can mark any of the replies that you received as helpful by clicking on the "Actions" menu and choosing "Mark as Helpful"