Doubts about MIl 2525c Symbology

2434
2
Jump to solution
12-27-2015 08:27 PM
Bhargav_KumarK
New Contributor

I am working on sample Advanced Symbology->Symbol Dictionary given in Arc GIS Qt Samples. As given in the sample we are able to draw symbols, move the symbol(using the call EsriRuntimeQt::MessageHelper::createUpdateMessage) but I am not able to select the symbol which I drawn on map.

In the documentation I found out that in order to select symbol I can use function

static Message EsriRuntimeQt::MessageHelper::createSelectMessage    (    const SymbolDictionaryType &     type,

const QString &     messageId,

const QString &     messageType,

const bool &     highlight

)   

How to use this function in order to achieve selection of symbol?

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Bhargav-

There seems to be a bug in our select method, which is setting the "_action" property incorrectly. Luckily, there is a workaround.

Can you try something like:

Message selectMsg = MessageHelper::createSelectMessage(SymbolDictionaryType::Mil2525C, “message_id”, “position_report", true);

selectMsg.setProperty(“_action”, “select”);  // set _action property to “select” or “un-select”

m_groupLayer->messageProcessor()->processMessage( selectMsg ); // process select message

View solution in original post

0 Kudos
2 Replies
LucasDanzinger
Esri Frequent Contributor

Bhargav-

There seems to be a bug in our select method, which is setting the "_action" property incorrectly. Luckily, there is a workaround.

Can you try something like:

Message selectMsg = MessageHelper::createSelectMessage(SymbolDictionaryType::Mil2525C, “message_id”, “position_report", true);

selectMsg.setProperty(“_action”, “select”);  // set _action property to “select” or “un-select”

m_groupLayer->messageProcessor()->processMessage( selectMsg ); // process select message

View solution in original post

0 Kudos
Bhargav_KumarK
New Contributor

Thanks Lucas Danzinger. It is working as you told.

How to select these graphics on mouse click?

I got these in one way,

EsriRuntimeQt::GraphicsLayer* m_graphicsLayer = (EsriRuntimeQt::GraphicsLayer *)m_messageGroupLayer->get(0);

connect(m_graphicsLayer, SIGNAL(graphicIdsComplete(const QList<qint64>&)), this, SLOT(onGraphicIdsComplete(const QList<qint64>&)));

m_graphicsLayer->graphicIds(event.x(),event.y(), 10); 

void Symbology::onGraphicIdsComplete(const QList<qint64>& hitGraphicIDs)

{

  qDebug()<<"in graphic ids complete";

  EsriRuntimeQt::GraphicsLayer *m_graphicsLayer = (EsriRuntimeQt::GraphicsLayer *)m_messageGroupLayer->get(0);

  for (int i = 0; i < hitGraphicIDs.length(); i++)

  {

    if (!m_graphicsLayer->isGraphicSelected(hitGraphicIDs.at(i)))

      m_graphicsLayer->select(hitGraphicIDs.at(i));

    else

      m_graphicsLayer->unselect(hitGraphicIDs.at(i));

  }

}

I am able to select mil2525c symbol created by using above procedure. Is there any other way to select graphic(mil2525c graphic) on mouse click?

0 Kudos