I've been a web developer for many years, but haven't really done much
with Google Maps yet, so please be gentle...
I want to have a world map where people click on a country to select
it. It should either update a form field with the country name or
redirect to that countries section of the site. Basically, this is to
replace the conventional country select list (which I'll also have for
people who prefer that).
Is this possible? I just want to select a country.
> I've been a web developer for many years, but haven't really done much
> with Google Maps yet, so please be gentle...
> I want to have a world map where people click on a country to select
> it. It should either update a form field with the country name or
> redirect to that countries section of the site. Basically, this is to
> replace the conventional country select list (which I'll also have for
> people who prefer that).
> Is this possible? I just want to select a country.
> If you've been a developer for many years, you should know better than
> to ask that question. Everything is possible, you just have to code
> it! :-)
ah, but no easy way? If it's too much of a mission then we'll probably
just go for an autocomplete or something like that.
On Sep 2, 1:40 pm, duncs <duncan.aus...@gmail.com> wrote:
> Hi
> I've been a web developer for many years, but haven't really done much
> with Google Maps yet, so please be gentle...
> I want to have a world map where people click on a country to select
> it. It should either update a form field with the country name or
> redirect to that countries section of the site. Basically, this is to
> replace the conventional country select list (which I'll also have for
> people who prefer that).
> Is this possible? I just want to select a country.
but it could be done for world countries. I requires a bit of work to
build the "click" / "rollover" grid.
If you are using it strictly for navigation to another web page,
static maps are much faster than dynamic maps. "usemap" MAPs with
AREAs are another option. You will have to convert from Lat/Lon
coordinates to pixel offsets. If you choose not to load the whole API
just to capture one click, you can use the following:
> I've been a web developer for many years, but haven't really done much
> with Google Maps yet, so please be gentle...
> I want to have a world map where people click on a country to select
> it. It should either update a form field with the country name or
> redirect to that countries section of the site. Basically, this is to
> replace the conventional country select list (which I'll also have for
> people who prefer that).
> Is this possible? I just want to select a country.
> > but it could be done for world countries. I requires a bit of work to
> > build the "click" / "rollover" grid.
> Thanks, this is what I'm looking for. Time to dive into the API docs!
The API docs will show you how to do it with one poly per country with
separate "click" / "mouseover" / "mouseout" event listeners for every
poly. With one hundred plus countries, the performance will be not be
great. For simple navigation to another web page, the 200KB API has
too much stuff you will never use.
On Sep 2, 5:44 pm, bratliff <bratl...@umich.edu> wrote:
> The API docs will show you how to do it with one poly per country with
> separate "click" / "mouseover" / "mouseout" event listeners for every
> poly. With one hundred plus countries, the performance will be not be
> great.
There are 3400+ counties in the US, and I don't think performance of
my map is a problem. And there's only one event listener, (map click).
The docs, (at least the reference), show you what's available, not how
to use it. That's up to you. :-)
On Sep 2, 5:30 pm, marcelo <marcelo...@hotmail.com> wrote:
> On Sep 2, 5:44 pm, bratliff <bratl...@umich.edu> wrote:
> > The API docs will show you how to do it with one poly per country with
> > separate "click" / "mouseover" / "mouseout" event listeners for every
> > poly. With one hundred plus countries, the performance will be not be
> > great.
> There are 3400+ counties in the US, and I don't think performance of
> my map is a problem. And there's only one event listener, (map click).
> The docs, (at least the reference), show you what's available, not how
> to use it. That's up to you. :-)
On Sep 2, 8:00 pm, bratliff <bratl...@umich.edu> wrote:
> But you do agree loading the entire 200KB API just to capture one
> click to send a person to another web page is overkill - right ?
I know that this is something you've mentioned several times, and in a
few cases it may be a issue, but with current availability of 20 Mbs
ADSL connections to any domestic user, I don't see it as a problem.
Even with 2 Mbs, the entire API, plus tiles, loads in just a couple of
seconds.
In the case of my map, (linked above), I do more than just register
one click, so I guess I need those 200 Kb.
> On Sep 2, 8:00 pm, bratliff <bratl...@umich.edu> wrote:
> > But you do agree loading the entire 200KB API just to capture one
> > click to send a person to another web page is overkill - right ?
> I know that this is something you've mentioned several times, and in a
> few cases it may be a issue, but with current availability of 20 Mbs
> ADSL connections to any domestic user, I don't see it as a problem.
> Even with 2 Mbs, the entire API, plus tiles, loads in just a couple of
> seconds.
> In the case of my map, (linked above), I do more than just register
> one click, so I guess I need those 200 Kb.
FWIW, the area data you display for counties does not match the facts
in the Wikipedia links.
For example, for Travis County TX (click on Austin) your site says
"911.59 mi^2." But the Wikipedia article says: "According to the
U.S. Census Bureau, the county has a total area of 1,022 square miles
(2,647 km²). 989 square miles (2,562 km²) are land and 33 square miles
(85 km²) (3.21%) are water."
Similar discriepancies are found for other counties that I spot-
checked.
On Sep 2, 1:26 pm, marcelo <marcelo...@hotmail.com> wrote:
> On Sep 2, 8:00 pm, bratliff <bratl...@umich.edu> wrote:
> > But you do agree loading the entire 200KB API just to capture one
> > click to send a person to another web page is overkill - right ?
> I know that this is something you've mentioned several times, and in a
> few cases it may be a issue, but with current availability of 20 Mbs
> ADSL connections to any domestic user, I don't see it as a problem.
> Even with 2 Mbs, the entire API, plus tiles, loads in just a couple of
> seconds.
> In the case of my map, (linked above), I do more than just register
> one click, so I guess I need those 200 Kb.
> FWIW, the area data you display for counties does not match the facts
> in the Wikipedia links.
Thanks for your comments!
At the time I got the data, (which came from the US Census Bureau), I
remember that there was a warning that the area and perimeter values
might not be accurate, but since the map is merely an "experiment" I
decided to keep it as it was.
On Sep 2, 8:50 pm, bratliff <bratl...@umich.edu> wrote:
> In the boondocks of northern Michigan - no cable - no DSL - no water -
> no sewer - no natural gas - just electricity & phone line.
OK, now I understand why you complain so much about the 200 Kb. :-)
I had always thought that the US were fully covered by modern
amenities, but maybe I haven't seen enough of it.
BTW, apologies to the original poster, as we seem to have hijacked the
thread. :-(
> On Sep 2, 8:50 pm, bratliff <bratl...@umich.edu> wrote:
> > In the boondocks of northern Michigan - no cable - no DSL - no water -
> > no sewer - no natural gas - just electricity & phone line.
> OK, now I understand why you complain so much about the 200 Kb. :-)
> I had always thought that the US were fully covered by modern
> amenities, but maybe I haven't seen enough of it.
> BTW, apologies to the original poster, as we seem to have hijacked the
> thread. :-(
It's a tradeoff - watch the Chicago to Mackinaw race from the front
porch or fight city traffic. It is not completely without amenities,
just beyond the 15,000 foot limit for DSL. Believe me, I have
inquired.
I am using the same Census Department cartographic boundary files you
are using. With the exception of one county added to Colorado since
2000, I am not aware of any discrepencies. Wikipedia allows anyone to
edit it.
On Sep 2, 9:40 pm, bratliff <bratl...@umich.edu> wrote:
> I am using the same Census Department cartographic boundary files you
> are using. With the exception of one county added to Colorado since
> 2000, I am not aware of any discrepencies. Wikipedia allows anyone to
> edit it.
I think this is what I remembered about inaccuracies:
"Please note: The first four fields - Area, Perimeter,
xxnn_d00_, xxnn_d00_I are produced as a by-product of
the cartographic boundary file creation process, and
have no meaning for public data users, therefore,
ignore or delete these fields."
"The cartographic boundary files are a generalized
extract from the U.S. Census Bureau's TIGER database.
Line simplification/smoothing was performed with a
tolerance of 0.005 decimal degrees and a coordinate
reduction using the Douglas-Peucker method with a
tolerance of 0.0003 decimal degrees. Very small
polygons were eliminated when the combination
of geographic codes existed elsewhere."
> "Please note: The first four fields - Area, Perimeter,
> xxnn_d00_, xxnn_d00_I are produced as a by-product of
> the cartographic boundary file creation process, and
> have no meaning for public data users, therefore,
> ignore or delete these fields."
When I look at the actual contents of the Area column referenced there
(in a downloaded sample shapefile), the value is a small decimal
fraction that is not remotely close the number your site reports as
square miles. (I can't even tell what the units are supposed to be in
the Census Area column.) So somewhere along the line, someone may
have done some conversion math.
The actual polygons in the shapefile, when measured empirically by my
GIS program (I use Manifold) correspond quite closely to the numbers
reported on Wikipedia and attributed to Census as the total area for
each county. And the Census American Fact Finder site reports the
same numbers.
On Sep 3, 2:56 am, boomerbubba <rossev...@austin.rr.com> wrote:
> When I look at the actual contents of the Area column referenced there
> (in a downloaded sample shapefile), the value is a small decimal
> fraction that is not remotely close the number your site reports as
> square miles. (I can't even tell what the units are supposed to be in
> the Census Area column.) So somewhere along the line, someone may
> have done some conversion math.
Yes, at the time I created that mashup, I just found some factor by
trial and error, and multiplied that small fractional number with it.
As I said before, it's not mission critical, so I'm happy with it as
it is.
> On Sep 3, 2:56 am, boomerbubba <rossev...@austin.rr.com> wrote:
> > When I look at the actual contents of the Area column referenced there
> > (in a downloaded sample shapefile), the value is a small decimal
> > fraction that is not remotely close the number your site reports as
> > square miles. (I can't even tell what the units are supposed to be in
> > the Census Area column.) So somewhere along the line, someone may
> > have done some conversion math.
> Yes, at the time I created that mashup, I just found some factor by
> trial and error, and multiplied that small fractional number with it.
> As I said before, it's not mission critical, so I'm happy with it as
> it is.