Link in the feature information window

41 views
Skip to first unread message

Abraham Coiman

unread,
Apr 23, 2017, 1:25:59 PM4/23/17
to Heron Mapping Client Development
Hello everybody

I'm developing a web mapping application for public transportation with Heron MC, GeoServer and Postgis. I need to show some point feature (bus stops) with photos.

Can someone help me how I can configure Heron MC so that the feature information window shows photos of bus stops and external links like this application:




Thanks in advance


AC





 

Mauro

unread,
Apr 25, 2017, 8:32:19 AM4/25/17
to Heron Mapping Client Development
About the links: you need to use gridCellRenderers in the featureinfo config. Here´s mine:

{type: "featureinfo", options: {
        pressed: true,
text: 'Información',
iconCls: 'binfo',
popupWindow: {
            width: 320,
            height: 200,
            featureInfoPanel: {
showTopToolbar: true,
showBottomToolbar: true,
                //displayPanels: ['Table'],
displayPanels: ['Table','Detail'],
                exportFormats: downloadFormats,
                hideColumns: ['objectid', 'gid'],
                maxFeatures: 10,
                autoConfigMaxSniff: 10,
gridCellRenderers: gridCellRenderers,  //<---here
                // In case that the same layer would be requested more than once: discard the styles
                discardStylesForDups: true
}
}
}},

before that, you have to define the gridCellRenderers in one of two forms:

1) using the widget directlink

var gridCellrenderers=[
{
   featureType: 'your_layer',
   attrName: 'the_field_that_conatains_the_link',
   renderer: {
  fn : Heron.widgets.GridCellRenderer.directLink,
  options : {
  target: '_new'
  }
   }
}]

2) Using a general render function to return an html link

var gridCellRenderers=[{
   featureType: 'your_layer',
   attrName: 'your_field',
   renderer: {
  fn : function(value, metaData, record, rowIndex, colIndex, store) {
  return '<a href="www.yoursite.com" target="_blank">'+ value +'</a>';
  }
   }
}]

I haven´t tried to put an image in the html, tell me if it works!

Abraham Coiman

unread,
Apr 25, 2017, 2:52:02 PM4/25/17
to geoext-vi...@googlegroups.com
Ok, thanks, I'll try it out.

--
--
You received this message because you are subscribed to the Google
Groups "geoext-viewer-devel" group.
To post to this group, send email to
geoext-viewer-devel@googlegroups.com
To unsubscribe from this group, send email to
geoext-viewer-devel+unsub...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/geoext-viewer-devel?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Heron Mapping Client Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geoext-viewer-devel/o0mJn5fip2U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geoext-viewer-devel+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages