Spectrum Spatial (SSA/LIM)

 View Only
  • 1.  Databind result templates

    Posted 07-09-2019 22:23
    Hi Guys,

    I just decided to give databinds a try.   I managed to get results from a MSSQL view, showing the closest 5 schools from a selected property.

    The question I have though is, can Templates be applied to these results?    I've created a template for the SQL table in Template Designer, but can't see anywhere to apply it to the results panel.

    Here's what it looks like at the moment.  (Pretty ugly)



    ------------------------------
    Tim Warfe
    GIS Officer
    MOORABOOL SHIRE COUNCIL
    ------------------------------


  • 2.  RE: Databind result templates

    Employee
    Posted 07-10-2019 03:06
    Hi Tim...  I don't know the technical answer here, however let me just say I applaud the effort... Let's see how the community help goes. 


    ------------------------------
    Kolt Luty
    Director – Telco Solutions
    Pitney Bowes Australia
    Sydney Australia
    M +61 417 841 680
    ------------------------------



  • 3.  RE: Databind result templates

    Posted 07-11-2019 20:39
    Edited by Duri Bradshaw 07-11-2019 20:41
    Hi Tim,

    I have had the same issue, our workaround is to do a FeatureSearch from the InfoTemplate so we can format the results as required.

    However it would be much simpler if we could just use the databind feature and define an InfoTempalte.

    I added the idea to the ideas portal https://ideas.pitneybowes.com/ideas/SSA-I-337

    ------------------------------
    Duri Bradshaw
    Spatial IT Consultant
    Insight GIS
    ------------------------------



  • 4.  RE: Databind result templates

    Posted 07-12-2019 01:16
    Thanks @Duri Bradshaw, I have voted for this idea also.

    Do you mind sharing the steps for implementing the FeatureSearch as described as I haven't done that before?  This may be useful for other things.  :)

    Thanks in advance.​

    ------------------------------
    Tim Warfe
    GIS Officer
    MOORABOOL SHIRE COUNCIL
    ------------------------------



  • 5.  RE: Databind result templates

    Posted 07-14-2019 20:12
    Hi Tim,

    It's a bit complicated as it's using extensibility but the trick is to call the featureSrvc with a SQL query from within your InfoTemplate.

    Something like this
    const query: { sql: string } = {
    	sql: 'SELECT * FROM "/tables/mytable" WHERE id = \'' + this.id + "'"
    };
    
    this.featureSrvc.searchBySql(query).subscribe(
    	value => {
    		console.dir(value);
    		result = value.features;
    	}
    );

    Obviously this is only a small snippet and you will require an understanding of extensibility in order to import the services, that discussion may be more appropriate in the SSA Developer Community.

    ------------------------------
    Duri Bradshaw
    Spatial IT Consultant
    Insight GIS
    ------------------------------