you can try the following:

add in your custom.js under your /config/your-config/ directory (usually 
'default') the following lines

$.extend(PM.Query,
{
     getQueryResult: function(qurl, params) {
         $.ajax({
             type: "POST",
             url: qurl,
             data: params,
             dataType: "json",
             success: function(response){
                 var mode = response.mode;
                 var queryResult = response.queryResult;

                 if (mode != 'iquery') {
                     $('#infoFrame').showv();
                     PM.Query.writeQResult(queryResult, PM.infoWin);
                     PM.ajaxIndicatorHide();

                    // NEW CODE
                    if (mode == 'search') {
                         var grpName = queryResult[0][0]['name'];
                         $('#ginput_' + grpName).attr('checked', true);
                         PM.Toc.setlayers(grpName, true);
                     }
                    // NEW CODE END

                 } else {
                     // Display result in DIV and postion it correctly
                     PM.Query.showIQueryResults(queryResult);
                 }
             },
             error: function (XMLHttpRequest, textStatus, errorThrown) {
                 if (window.console) console.log(errorThrown);
             }
         });
     }
})

Note that this quick hack might not work in all cases and might have 
some inconsistencies left, so it might needed to be refined. One could 
e.g. trigger the click event for the checkbox, which very likely will 
cause a double reload of the map though, though...

If you want, add a ticket in the pmapper TRAC as new feature request, so 
the idea is not getting lost and it might get implemented in a cleaner 
way in the core code.

Armin

On 23/01/2012 14:10, i...@architekten.coop wrote:
> dear pmapper users
>
> i am using pmapper 4.1.0
> when i make a search e.g. in the pmapper-demodata
> for a river, but the layer river is not activated, it would be nice, when
> that layer river could be turned active by the search process.
> ist that possible with short piece of code ?
>
> thank you very much
>
> matthias moser switzerland
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> pmapper-users mailing list
> pmapper-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to