Friday, January 27, 2012

Re: [Google Maps API v2] Google Key Not Working.

The request.getRequestURL() is supposed to retrieve the name of the site and not IP address.

If you get key for name of your site instead of IP address, there will be no problem during any change of sever for a site.

I am using separate keys for different domain names.
Since most of the pages were common for each domain, all the keys are inserted on every single file.

The source code of this page shows the way to group all keys in a single page.

 http://www.replyat.com/guesthelp1.htm

On Fri, Jan 27, 2012 at 12:35 PM, ravi chandra <meetraviraj307@gmail.com> wrote:
In our web app we are using google map api, some day ago everything
was going fine with Airtel ISP since last 2 or 3 years,
but recently our ISI has changed to Relience and we got new IP ,now
problem started,
we got new key for our new IP but it,s not working.
In am giving my script code here..
<script language="javascript" type="text/javascript">
   var googlekey="";
   var key ='<%= request.getRequestURL() %>';
   if(key.indexOf('115.248.112.195')>='0'){
      googlekey="AIzaSyA57QU7HgQXP1x_8Ye_VKrsgV4yyDS6ZFI";
      <c:set var="googlekey"
value="AIzaSyA57QU7HgQXP1x_8Ye_VKrsgV4yyDS6ZFI"/>
   }else if(key.indexOf('115.248.112.194')>='0'){
     googlekey="AIzaSyA8jKlc2SwSL8qO4JtSQSzUJg5oxILt0Fc";
     <c:set var="googlekey"
value="AIzaSyA8jKlc2SwSL8qO4JtSQSzUJg5oxILt0Fc"/>
   }
   </script>
and we are including this script page where-ever we are using map.
and in that page we are writting our script like--

function initLoader() {
    var script = document.createElement("script");
    script.type = "text/javascript";
      script.src = "http://maps.google.com/maps?
file=api&v=2&key="+googlekey+"&async=2&callback=loadMap";
    document.body.appendChild(script);
    setTimeout('',6000);
    }

but problem continues..
please help us...
Thanking all of you in advance..

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate