Each crime page has (had) a Google map on it. With the API, that's not possible, because the API limits a key to a directory. I would have to register a specific API key for each crime in the system.
About 1,000 crimes get added each day.
The problem is that this setup "punishes" clean, pretty URLs such as the ones I'm using. If I used ugly abominations such as http://www.chicagocrime.org/?crime=2005/jun/14/12am/hl419247/, it would work as is. But that would be an ugly abomination.
Yes, I could use iframes, but those aren't ideal. That would require separate server-side code that's unnecessarily complex.
I'm not sure what the goal of the directory limit is, but in this particular case it doesn't make sense. Please let the API be used on a per-*site* basis instead of a per-directory basis.
This is the same problem I'm running into. I'm unable to make my URLs look nice. I hope they get the key system worked out quickly. I'd like to take my site live sometime soon, but I want it to look spiffy also.
FWIW, this would also open up some creative uses of GMaps on Blogger, by allowing maps in blog entries. (Under Blogger, main and archive pages appear at top-level; individual post pages in year/month subdirectories; so one GMaps key won't cover a post for all URLS it appears on.)
I've run into the problem that since I registered my api key without
the www in the domain name any time you use the www in the url it
rejects the user. If google must limit it to a directory I just hope
they remove this limitation so both http://www.sitename.com/maps/ and
http://sitename.com/maps/ works.
I get around this by embedding the map in an iframe hitting a dynamic page that is in a dir that you have the kye for. Using iframes makes me feel on the unclean side, but it gets around the problem.
Adrian Holovaty wrote: > The problem is that this setup "punishes" clean, pretty URLs such as > the ones I'm using. If I used ugly abominations such as > http://www.chicagocrime.org/?crime=2005/jun/14/12am/hl419247/, it would > work as is. But that would be an ugly abomination.
> I'm not sure what the goal of the directory limit is, but in this > particular case it doesn't make sense. Please let the API be used on a > per-*site* basis instead of a per-directory basis.
A key *won't* work for a whole domain. But 'mysite.com' and
'mysite.com/foo' are in the same domain, and it doesn't work for them
either. Making a key applicable to child directories solves the
problem except, as you noted, in the case where someone decides to get
a key for 'geocities.com' (actually that's a bad example, because those
sites have always exceeded their bandwidth anyway... I haven't seen a
working geocities site in years).
The thing that I think is important is that the only time this will be
a problem is when a high-level domain key gives a bunch of subdomains
access and the number of hits gets out of hand. But Google has already
set a maximum number of hits per month, and if a domain started running
amok it is a simple thing to squash that key and alert users via
javascript that they need to get a key of their own. I assume that
Google already has some mechanism in place to prevent abuse of their
system... use it to police the troublemakers, instead of restricting
everyone else's access.
mod_rewrite isn't an option for Blogger users. The only way to
guarantee that a map works in Blogger is to get separate keys for the
main page, each archive page, and each post page that includes a map,
then do some ridiculous javascript-fu to make sure the scripts are
called in the correct context. Just another way of saying "it's
impossible", really, since it becomes a bookkeeping nightmare pretty
fast plus Google has to give out at least 3 keys for every map use.
mike...@gmail.com wrote:
> I think one big part of the reason is for hosting sites like
> geocities.com, livejournal.com, etc. Obviously a key won't work for
> the whole domain.
> A key *won't* work for a whole domain. But 'mysite.com' and
> 'mysite.com/foo' are in the same domain, and it doesn't work for them
> either. Making a key applicable to child directories solves the
> problem except, as you noted, in the case where someone decides to get
> a key for 'geocities.com' (actually that's a bad example, because those
> sites have always exceeded their bandwidth anyway... I haven't seen a
> working geocities site in years).
> The thing that I think is important is that the only time this will be
> a problem is when a high-level domain key gives a bunch of subdomains
> access and the number of hits gets out of hand. But Google has already
> set a maximum number of hits per month, and if a domain started running
> amok it is a simple thing to squash that key and alert users via
> javascript that they need to get a key of their own. I assume that
> Google already has some mechanism in place to prevent abuse of their
> system... use it to police the troublemakers, instead of restricting
> everyone else's access.
> mod_rewrite isn't an option for Blogger users. The only way to
> guarantee that a map works in Blogger is to get separate keys for the
> main page, each archive page, and each post page that includes a map,
> then do some ridiculous javascript-fu to make sure the scripts are
> called in the correct context. Just another way of saying "it's
> impossible", really, since it becomes a bookkeeping nightmare pretty
> fast plus Google has to give out at least 3 keys for every map use.
> - foobario
> mike...@gmail.com wrote:
> > I think one big part of the reason is for hosting sites like
> > geocities.com, livejournal.com, etc. Obviously a key won't work for
> > the whole domain.
I've also found a way to have the script needed to create a map import into a blog post or non-licensed website. I'll try to document some of this hack later this week. I won't release the code to cross-site script the maps however as I don't want to be responsible for breaking Google's licensing system...I'm sure they'll improve upon the current limitations soon enough.