views:

9

answers:

0

I am using google maps api on my Flex website. My website has ssl.

So the issue is, everything was working fine a couple of days back, but the google map api stopped working suddenly. And I can not see the reason.

my code for maps looks like below:

<maps:Map 
                id="map" 
                mapevent_mappreinitialize="{init()}"
                key="{getGoogleMapsKey()}"                  
                mapevent_mapready="onMapReady(event)"
                width="100%" height="100%" />

and the init and getGoogleMapsKey function looks like:

private function init():void{
            Security.allowInsecureDomain("maps.googleapis.com");
            XML_URL=ServerConfig.get_rpc_base_url();
            getZipRequest.send();
        }                       
        private function getGoogleMapsKey():String {
            switch(ServerConfig.get_config_vars('web_server_url'))
            {                       
                    case 'http://cloud.cm': return 'ABQIAAAA0L1JEoR6rWjh-BBQnLMtMBTBpEXyAqmkMUmBI_vSo_EMsFX3ihSus4gyyLPNy3eAksVIfvrgS2rOvg';
                    default: return 'ABQIAAAA0L1JEoR6rWjh-BBQnLMtMBTW_Qkp6J0z76Etz3qzo8Hg3HdUQhSnD6lqp53NB0UrBmg5Xm2DlazWqA';//'ABQIAAAA0L1JEoR6rWjh-BBQnLMtMBRxvOsHAwlcwN-ZaDcSOgH1w6sIURS6ttpbOLzdKaK8Wzi0-YjckgxFsA';
                    break;
            }
        }

So as mentioned in google maps api faqs, about SSL website, to use Security.allowInsecureDomain before the maps initialization, I am doing so. And this was working a couple of days back as well. But now when I open my google maps application, is gives me the error: "Initialization failed: please check the API key, swf location, version and network availability".

I have tried changing the API key again. But still it is giving me the same error.

Please help me out with this. I have no idea why the code stopped working suddenly.

Regards Zeeshan