I am using the below string of code to display an InfoWindow (bubble) for a map marker. I have a "Details" link that opens the list item associated with the map marker in a new tab. Ideally I want this to open in a modal dialog. How can I incorporate this into the below line of code?

var marker = new google.maps.Marker({map: map, position: results[0].geometry.location, icon: rows[idx].MarkerIcon, content: '<b>'+rows[idx].Title+'</b><br />'+rows[idx].Location+'<br /><b>WiFi: </b>'+rows[idx].WiFi+'<br /><b>Printer: </b>'+rows[idx].Printer+'<br /><b>Toilet: </b>'+rows[idx].Toilet+' <a href="https://liverty.sharepoint.com/sites/resourcehub/Lists/Locations/DispForm.aspx?ID='+rows[idx].ID+'" target="_blank">Details</a>', title: rows[idx++].Title});
  • I can't help with this question, but I thought I'd mention there is also a GIS SE forum - in case you don't get an answer here, you could try there otherwise. – Tally Jun 25 '18 at 8:41
  • Solved. By adding the following: " target="_blank" onclick="javascript:this.href = unescapeProperly(escape(this.href)); (function (url) {var opt = {url: url, autoSize: true, dialogReturnValueCallback: function(res, retVal) { if (res === SP.UI.DialogResult.OK) { /*do something useful*/ } }}; SP.UI.ModalDialog.showModalDialog(opt);})(this.href); return false;">Details</a>', title: rows[idx++].Title}); – surfnode Jun 25 '18 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.