0

For Flex mobile there are several ways to display maps using .swc files coming from Google (deprecated), ArcGIS, MapQuest and probably more...

Then probably an embedded browser (StageWebView component)could be used with Google maps JS API...

And finally a static map image by Google could be used - I use it currently in my desktop to mobile quick-port, but it looks ugly and can't be panned:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        title="{data.city}">

    <fx:Declarations>
        <s:MultiDPIBitmapSource id="BACK"
            source160dpi="@Embed('assets/icons/low-res/back.png')"
            source240dpi="@Embed('assets/icons/mid-res/back.png')"
            source320dpi="@Embed('assets/icons/high-res/back.png')"/>
    </fx:Declarations>

    <fx:Script>
        <![CDATA[   
            private static const MAP:String = 
                'http://maps.google.com/maps/api/staticmap?sensor=false&language=ru&maptype=roadmap&size=400x400&markers=';
        ]]>
    </fx:Script>

    <s:states>
        <s:State name="portrait"/>
        <s:State name="landscape"/>
    </s:states> 

    <s:navigationContent>
        <s:Button icon="{BACK}" label.landscape="Назад" click="navigator.popView()"/>
    </s:navigationContent>

    <s:BitmapImage source="{MAP + '' + encodeURI(data.city)}" width="100%" height="100%" scaleMode="zoom" />

</s:View>

enter image description here

But my question is: is there maybe a way to use the native maps delivered with Android devices and iPhones/iPads by creating some special URL (map:/// ?) and calling navigateToUrl on it?

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416

1 Answers1

1

On Android, you are welcome to use geo: URL values. Whether they will work from Flex, and whether iOS supports that scheme as well, I cannot say.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491