开发者

Alternative to google map api, so that I can use it on a HTTPS/SSL encrypted website

I did find a solution for this on Google map api page, and I made the following changes as mentioned in it.

1.Use Google Maps API for Flash version 1.9a or later.

2.Add the following to your Flash application before the map is instantiated: Security.allowInsecureDomain("maps.googleapis.com");

Ref:http://code.google.com/apis/maps/faq.html#flash_ssl

My code looks like this, after the changes:

<mx:TitleWindow  verticalAlign="middle" horizontalAlign="center"
    xmlns:mx="http://www.adobe.com/2006/mxml" 
    xmlns:maps="com.google.maps.*" 
    width="1000" height="600" layout="absolute" backgroundAlpha="0" borderAlpha="0" borderThickness="0" 
    showCloseButton="true" close="PopUpManager.removePopUp(this);">

<mx:VBox width="70%" height="100%" >
                <maps:Map 
                    id="map" 
                    key="ABQIAAAA0L1JEoR6rWjh-BBQnLMtMBSVuZ5VlaqlIqiYPFMK_I5M2UTmHhSq_BJxLHiYcTDW9RxSF6HewNY7uA" 
                    mapevent_mapready="onMapReady(event)"
                    width="100%" height="100%" />
            </mx:VBox>
<mx:Script>
        <![CDATA[
            //import flashx.textLayout.formats.Direction;
            import mx.effects.AddItemAction;
            //import flashx.textLayout.factory.TruncationOptions;
            import mx.controls.Alert;
            import mx.managers.PopUpManager;
            import mx.rpc.events.ResultEvent;
            import com.adobe.serialization.json.JSON;

            import flash.events.Event;
            import com.google.maps.*;
            import com.google.maps.overlays.*;
            import com.google.maps.services.*;
            import com.google.maps.controls.ZoomControl;
            import com.google.maps.controls.PositionControl;
        开发者_Go百科    import com.google.maps.controls.MapTypeControl;

            import com.google.maps.services.ClientGeocoderOptions;
            import com.google.maps.LatLng;
            import com.google.maps.Map;
            import com.google.maps.MapEvent;
            import com.google.maps.MapMouseEvent;
            import com.google.maps.MapType;
            import com.google.maps.services.ClientGeocoder;
            import com.google.maps.services.GeocodingEvent;
            import com.google.maps.overlays.Marker;
            import com.google.maps.overlays.MarkerOptions;
            import com.google.maps.InfoWindowOptions;

            private function onMapReady(event:MapEvent):void {
            Security.allowInsecureDomain("maps.googleapis.com");
              map.setCenter(new LatLng(41.651505,-72.094455), 13, MapType.NORMAL_MAP_TYPE);
              map.addControl(new ZoomControl());
              map.addControl(new PositionControl());
              map.addControl(new MapTypeControl());

              map.enableScrollWheelZoom();
                map.enableContinuousZoom();

            }
]]>
    </mx:Script>
</mx:TitleWindow>

But i still get the following error using this: The requested URL /mapsapi/publicapi?file=flashapi&url=https%3A%2F%2Fvirtual.c7beta.com%2Findex_cloud.swf&key=ABQIAAAA0L1JEoR6rWjh-BBQnLMtMBTW_Qkp6J0z76Etz3qzo8Hg3HdUQhSnD6lqp53NB0UrBmg5Xm2DlazWqA&v=1.18&flc=xt was not found on this server.

Any suggestions to what am I doing wrong here, what should i do to make this work.

Regards zee


Does your subject line have any relation to your question?

I'm shooting a bit in the dark here, but based on the error you're seeing it looks like it may be pinging your local server; for the URL; not the remote server. Have you run in debug mode to find out which line has the error and what exactly is going on at that time/

To answer your subject line, I know their are alterantives to Google Maps. I know one is ESRI:

I'm not sure if, or how, they support SSL.


You are trusting the insecure domain (Security.allowInsecureDomain) to late, you have to do that before you instantiate the map. I had the same problem, trusting before instantiating the map solved it for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜