0
我想縮放我的繪圖像flex中的地圖,但所有我所做的都是通過HSlider縮放。你能解釋我如何縮放我的繪圖像谷歌地圖?縮放繪圖像flex中的地圖
這裏是我的變焦代碼: 我的縮放功能:
private function doZoom(component:UIComponent,val:Number):void
{
if(component is Container)
{
var children:Array = Container(component).getChildren();
for(var i:int = 0; i < children.length; i++)
{
zoomChildren(children[i], val);
}
}
}
private function zoomChildren(component:UIComponent,val:Number):void
{
component.scaleX = val;
component.scaleY = val;
if(component is Container)
{
var children:Array = Container(component).getChildren();
for(var i:int = 0; i < children.length; i++)
{
doZoom(children[i], val);
}
}
}
public function applyZoom():void
{
if(pnl == null)
{
return;
}
doZoom(pnl,zoomSlider.value);
}
和我的組件:
<s:VGroup>
<s:Button label="Загрузить SVG" click="PathsService.getPaths()"/>
<mx:Panel y="30" width="1300" height="600" id="pnl" title="Отрисовка SVG" borderColor="#008040" fontFamily="Arial" fontWeight="bold" fontSize="13">
<s:VGroup height="100%" width="100%" clipAndEnableScrolling="true">
<s:SpriteVisualElement width="100%" height="100%" id="spr" />
</s:VGroup>
</mx:Panel>
<s:HGroup height="100%" width="100%">
<s:Label text="Zoom" x="250"/>
<mx:HSlider id="zoomSlider" minimum=".1" value="1"
maximum="2" change="applyZoom()" width="180" x="300"/>
</s:HGroup>
</s:VGroup>