Asign bookmark (extent) to link (image)

3812
3
Jump to solution
05-15-2015 04:15 AM
RaimondsVerpejs
New Contributor II

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

example.png

Edit fiddle - JSFiddle

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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);
      });

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

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);
      });
RaimondsVerpejs
New Contributor II

thx!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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"

0 Kudos