My project is an achitectural view of a sliced building where i make polygonal hotspot on apartments.
I use this.hotspotProxyClick=function(id) in the skin.js and put code to get and show some external information in sql database, it work well.
But i need extra informations of differents polygonals hotspots like vertices coordinates, i could have them in the xml but i don’t understand the way it is formated
for example in the xml i’ve got :
Code: Select all
<polyhotspot title="" target="" url="" id="0-001-T3" reuse="0">
<polygon row="0" vertices="0.483854,0.398148;0.540625,0.462963;0.558333,0.439815;0.552604,0.434259;0.555729,0.430556;0.563021,0.438889;0.564583,0.437037;0.572396,0.426852;0.602604,0.387037;0.61875,0.362037;0.557813,0.308333;0.545313,0.325926" column="0" state="1" />
</polyhotspot>
Code: Select all
<hotspot>
<type>poly</type>
<id>0-001-T3</id>
<reusecolumn>0</reusecolumn>
<reuserow>0</reuserow>
<reusestate>0</reusestate>
<polyitem>
<column>0</column>
<row>0</row>
<state>1</state>
<polygons>(929,430)(1038,500)(1072,475)(1061,469)(1067,465)(1081,474)(1084,472)(1099,461)(1157,418)(1188,391)(1071,333)(1047,352)</polygons>
</polyitem>
</hotspot>
So i wonder if i can use javascript to know attibute of polygonals hotspots and how to do that ?
If i try :
Code: Select all
this.hotspotProxyOver=function(id) {
console.log(id)
}
When i try with jQuery :
Code: Select all
this.hotspotProxyOver=function(id) {
console.log($(id))
}
i’ve got : Object { length: 0, prevObject: {…} } but there’s nothing inside, i don’t know if there’s attribute on this object and how to get them.
Otherwise i’ve got different apartments with different informations like number of rooms and i want to show different kind of color by the number of rooms for example blue for 3 rooms apartment and red for 4 rooms apartments.
I wonder if it’s possible to change the backgroundcolor and the backgroundalpha «on the fly» in
Code: Select all
<polystyle mode="2" backgroundalpha="0.500" backgroundcolor="0xffffff" bordercolor="0x000000" borderalpha="1.000"/>';
Thanks for your help.