How do I use an API key with Google Static Maps? -
i'm trying work google static maps keep getting 403 errors , have had confusion trying figure out. if right-click on broken image , choose "open in new tab" load fine, , after load fine on actual page i'm embedding it. i'm not sure why working way.
i've read 403 means hit quota limit, although low-traffic server. tried setting api key i'm rather confused how supposed work. google's documentation static maps says need create "server key" key should kept private on server , not embedded on page. how use server key without putting in source of image tag?
i've read elsewhere on stackoverflow should use "browser key" instead. seems work okay there many domains intend use on , can't put of them in allowed referrers. should let allow referrer?
i'm using v2 api urls this: http://maps.googleapis.com/maps/api/staticmap?center={someaddress}&size=250x250&zoom=14&key={mykey}
you can use browser key static maps, don't need server key. have multiple options here if want use browser key on multiple domains.
it possible allow referrers on browser key, run risk other people start using api key well. if haven't setup billing, highest risk take images become unavailable because else used key , therefore hit quota.
the second option use separate browser api key per domain. can set allowed referrers per domain.
Comments
Post a Comment