• P
    Phillip Weeks

    Interestingly enough Jared I got the info-window working with dynamic content in a separate dashboard using a querystring but if I call this db from another db using its ui-state, the dynamic content breaks as the info-window loses scope on the variables for some reason? If I refresh the window it restores the scope and it can display the dynamic content. So I dunno what it could be, i's curious and frustrating. :)

    posted in User help read more
  • P
    Phillip Weeks

    Strangely enough I had it working with a {{'path'+mypoint.deviceName}} inside the image tag and I could see the all the object inside the info-window. It was dynamically building a filepath out of the DSname and working great. I changed the structure of a few md-cards, and some style stuff and before I realized scope was broken again without doing anything inside the <ma-map section. So something is very odd about it for sure. Is there a way to copy a point variable to a <script> variable?

    posted in User help read more
  • P
    Phillip Weeks

    So I really cannot figure out why some of this works and some of it does not work.
    If I put the two expressions one after the other the value outputs correctly.
    If I remove either of these expressions for one variable no value will display.
    If I try to put either expression in as an image parmeter it will not work but works if I hard code it in. What in the world is going on?

      <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                        <marker id="marker1"  position="{{myValue.lat}},{{myValue.lon}}"  icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                        </marker>
                        <info-window id="Info1">    
                            <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                <center> 
                                             {{myItem.jaonData.clientname}}  
                                             {{myValue.clientname}}
                                             <br>
                                             {{myItem.jaonData.tonnage}}  
                                             {{myValue.tonnage}}
                                             &nbsp;Ton Unit
                                             <br>
                                             {{myItem.jaonData.installpic}}  
                                             {{myValue.installpic}}
                                             <br>
                                             {{myItem.jaonData.phone}}  
                                             {{myValue.phone}}
                                             <br>
                                             {{myItem.jaonData.address}}  
                                             {{myValue.address}}
                                             <hr>
                                    <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="{{myItem.jaonData.installpic}}"></img>
                                </center>
                            </div>
                            </info-window>
                        
                       </ma-map>
    

    0_1565028816541_3451342d-465e-472a-b2d4-744a5fb37ce7-image.png

    and hardcoded...

       <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                        <marker id="marker1"  position="{{myValue.lat}},{{myValue.lon}}"  icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                        </marker>
                        <info-window id="Info1">    
                            <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                <center> 
                                             {{myItem.jaonData.clientname}}  
                                             {{myValue.clientname}}
                                             <br>
                                             {{myItem.jaonData.tonnage}}  
                                             {{myValue.tonnage}}
                                             &nbsp;Ton Unit
                                             <br>
                                             {{myItem.jaonData.installpic}}  
                                             {{myValue.installpic}}
                                             <br>
                                             {{myItem.jaonData.phone}}  
                                             {{myValue.phone}}
                                             <br>
                                             {{myItem.jaonData.address}}  
                                             {{myValue.address}}
                                             <hr>
                                             <img  width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="{{'/rest/v2/file-stores/public/Res_Client_Pics/SBUTLER1.jpg'}}"></img>             
                                             
                                </center>
                            </div>
                            </info-window>
                        
                       </ma-map>
    

    0_1565027932832_35d2d512-060b-4d2d-8d04-d331148e1dc8-image.png

    posted in User help read more
  • P
    Phillip Weeks

    I thought I could recreate the JSON record as a new object inside the info-window scope but it cannot find the dataSourcesArray[0].xid value inside the
    <info-window?? So I still don't know how to resolve the scope issue. Seems like I lose reference to the variables inside the info-window. Surely this is a known issue else there would be plenty of examples of it working.

    posted in User help read more
  • P
    Phillip Weeks

    Sorry for switching the nomenclature there I rewrote it a few times so I changed the names but I went back to the original and did and created the instance in an outside div and still no sign of them within the info-window

       <div ng-init="InfoRecord = {}">
                          <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="InfoRecord" value="InfoValue"></ma-json-store>
                          {{InfoValue.name}} {{InfoValue.xid}} {{InfoValue.tonnage}} {{InfoValue.lat}} {{InfoValue.lon}}
                        
                          <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="InfoValue.lat" long="InfoValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                           
                             <marker id="marker1" position="{{InfoValue.lat}},{{InfoValue.lon}}" icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                            </marker>
                             
                             <info-window id="Info1">    
                                <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                    <center> <h3>Lat: {{InfoValue.lat}}</h3><br>
                                                Lon: {{InfoValue.lon}} <hr>
                                        <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                                    </center>
                                </div>
                            </info-window>
                            </ma-map>
                           
                           </div>
                        </div>
    

    posted in User help read more
  • P
    Phillip Weeks

    @phillip-weeks said in Help Using <ma-map & <info-window:

    xid="{{dataSourcesArray[0].xid}}

    I used the sames variables that creates the map and marker lat and long inside the info-window and there is still no value for these??
    0_1565014782932_8926c489-a6f4-4eb3-a361-dc1d61c1404f-image.png

    
    
    

    <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="myItem" value="myValue"></ma-json-store>

     <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="myValue.lat" long="myValue.lon" map-type="HYBRID" info-window-theme="dark" center="[44.654224,-63.586408]" desktop-height="800px" mobile-height="600px" zoom="13" style="width: 50%; height: 0px;">
                           
                             <marker id="marker1" position="{{myValue.lat}},{{myValue.lon}}" icon="{url:'/rest/v2/file-stores/public/Thermostat/red-circle-xxsmall.png'}" draggable="false" on-click="$parent.$ctrl.toggleInfoWindow('Info1', 'marker1')">
                            </marker>
                            <info-window id="Info1">    
                                <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                                    <center> <h3>Lat: {{myValue.lat}}</h3><br>
                                                Lon: {{myValue.lon}} <hr>
                                        <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                                    </center>
                                </div>
                            </info-window>
                            
    

    posted in User help read more
  • P
    Phillip Weeks

    The map loads a JSON file and renders coordinates properly using values retrieved from this file but I cannot figure out how to get these same JSON variables into the info-window?

     <ma-json-store xid="{{dataSourcesArray[0].xid}}" item="InfoRecord" value="InfoValue"></ma-json-store>
                        {{dataSourcesArray[0].xid}}  --  {{InfoRecord.name}} -- {{InfoRecord.jsonData.name}} -- {{InfoRecord.jsonData.tonnage}}
                    <info-window id="Info1">    
                        <div style="font-size: 10px; font-weight: bold; font-family: sans-serif; text-align: center; font-style: normal; line-height: 14px; background-color: lighblue; color: red">
                            <center> <h4>{{InfoRecord.jsonData.name}}</h4><br>
                                {{InfoRecord.jsonData.tonnage}} Ton Air to Water Heat Pump<br>
                                 {{InfoRecord.jsonData.address}}<br>
                                 {{InfoRecord.jsonData.phone}}
                                <hr>
                                <img width="80%" id="22b873fe-0514-48cc-9c29-c5ba0276673b" src="/rest/v2/file-stores/public/Q-Lofts_xSmallPic.png"></img>
                              
                            </center>
                              
                        </div>
                        </info-window>
                  
    

    Result:
    0_1565012150056_2c92f9fa-e61b-48d6-ab62-95d025eb4f37-image.png

    posted in User help read more
  • P
    Phillip Weeks

    Problem resolved. So I discovered not all our data sources have identical point names and one of the common points I was using to identify its device name did not exist in certain DS so it reverted to the previous values in the data sources array.
    This was nothing to so with the JSON store functionality and its all working as it should now . :) Thanks again guys.

    posted in How-To read more
  • P
    Phillip Weeks

    Everything works great when <ma-json-store> finds the JSON File matching the current DS xid however when the file is not found, it loads xid values from a previous JSON file creation??

    These expressions have two different values for the dataSourcesArray[0].xid and dataSourcesArray[0].name?

    <ma-json-store xid={{dataSourcesArray[0].xid}} item="ClientInfo" value="myValue"></ma-json-store>

    If the JSON file with the xid doesn't exist this directive loads an xid value and name value in the New ClientInfo record as "DS_549018", "DS_549018",

    yet {{dataSourcesArray[0].xid}} renders "DS_096207" and {{dataSourcesArray[0].name}} is "DRYAN" which is the correct xid and name for the DS in the designer.watchlist.

    0_1564841075975_2c1affeb-c44b-40de-a545-14f754de3de8-image.png

    posted in How-To read more
  • P
    Phillip Weeks

    So I have a more specific question about using the directive
    If we have one json file for each DS how do I seed values in the input boxes with stored data using the directive below and the current DSxid as the json file xid?
    OK so this is retrieving the data.
    Thanks again guys. Great solution!
    <ma-json-store xid={{dataSourcesArray[0].xid}} item="ClientInfo" value="myValue"></ma-json-store>

    0_1564782119957_6f57b3e1-2386-4b3b-b54b-20750036981b-image.png

    posted in How-To read more