Tim Cadieux
Tim Cadieux

Reputation: 455

AMMaps - how to use target= _blank

I am able to set theURL to be clicked when someone clicks on a province but it opens in the current window, I would like it to open in 'new' or '_blank'.

"dataProvider": {
      "map": "canadaHigh",
      "areas": data,
      "urlField": "url",
      "urlTarget": "new"          
    }

Upvotes: 1

Views: 282

Answers (1)

xorspark
xorspark

Reputation: 16012

You can't set urlTarget at the mapData/dataProvider level. Unfortunately the documentation is a bit misleading at the moment. I notified the team about this and they're looking into it.

The correct way to set the urlTarget is in each individual mapArea/mapImage, for example:

  "dataProvider": {
    "map": "worldLow",
    "areas": [{
      "id": "CA",
      "urlTarget": "_blank",
      "url": "http://google.ca"
    }, {
      "id": "US",
      "urlTarget": "_blank",
      "url": "http://google.com"
    }]
  },

Demo

Upvotes: 1

Related Questions