TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

I made an example app to show how Google map URLs should look

305 点作者 captainbenises大约 12 年前

42 条评论

micheljansen大约 12 年前
I think trying to make geo URLs nicer is a noble effort, but this approach takes a far too naive world view.<p>Addresses are messy. In most parts of the world (even the "western world"), addresses are hopelessly ambiguous and much of the world cannot nearly as nicely be divided into a neatly hierarchical addressing system as this example suggests.<p>Real-world addresses are ambiguous, confusing and messy. Pretty much the opposites of qualities that make for a good URL scheme.<p>How do you deal with multiple places with the same name, or one place that is known by many names? Disambiguation pages and 304 redirects to a single canonical name (which might piss a <i>lot</i> of people off if it's a disputed area)?<p>Most civilised parts of the world have developed more precise, less ambiguous addressing systems over time, using post codes and other systematic approaches, but even those are not always watertight, often volatile and only work for places where some body issued them (good luck in the desert or ocean).<p>Geocoding is hard, and reverse geocoding (from a place to a name) is even harder, but fortunately we already have a clear, concise and unambiguous way to address places on earth: the Geographic Coordinate System. Every place on earth can be addressed using a simple latitude/longitude coordinate pair. It's not pretty or user friendly, but at least it's fool-proof.<p>Why not take a much simpler approach, similar to how many blogging platforms generate pretty urls from post titles?<p>The URL in the example could then be:<p><pre><code> https://maps.example.com/37.769944,-122.422264/199-Valencia-St-San-Francisco </code></pre> Or just as conveniently:<p><pre><code> https://maps.example.com/37.769944,-122.422264/Zeitgeist-Bar </code></pre> This way, multiple URLs can exist for different entities in the same geographic space.<p>Multiple places with the same name are also much less of a problem this way:<p><pre><code> https://maps.example.com/51.528642,-0.101599/High-Street </code></pre> vs<p><pre><code> https://maps.example.com/51.528642,-0.101599/High-Street </code></pre> For a real-word mapping service, there would probably be a need to specify a zoomlevel or bounding box, but those could be provided as URL parameters. Ironically, this is very close to how the URLs in Google Maps currently look. Not as nice, but at least it's actually feasible and future-proof.
评论 #5625655 未加载
评论 #5626792 未加载
chewxy大约 12 年前
I understand the need for a nice URL, perhaps indicative of RESTfulness, but I see a few problems with this:<p>1. From a REST point of view - the map is the resource. The adddress is well, not really a resource (the logic goes like this: if the address is the resource, the browser as a resource getter should only get the address, not the surrounds). IMHO the address should be modelled as an element of the resource, accessible by Maps' javascript.<p>2. Of course you can have nice URLs without being indicative of RESTfulness. Consider an address in Japan. They do not have road names, instead, they use building/block numbers for naming/addressing. While that can still be modelled as a nice URL, the convention is now flipped, and people will be confused<p>3. Consider that some places do not actually have an address. Like my former residence. Due to changes in the roads, my place had a new road with no name, and no actual address (well, eventually it did, and the road still has no name. Getting pizza delivered was tough)<p>What can be done of course is a bit.ly kind of thing, which I think will work. Something like /maps/199-valencia-street-san-francisco-california-united-states. The current google maps url is already kinda like that (with ?q I believe)
评论 #5624817 未加载
评论 #5624770 未加载
评论 #5626932 未加载
rtpg大约 12 年前
I live in Japan , your app doesn't work for me<p>I tried searching 日本東京都足立区足立2丁目 (google suggestion) and your app doesn't accept.<p>we're able to get all the computers in the world to be more or less on the same network but we still can't figure out encoding problems from 1982<p>edit: I messed up writing this, should have been 足立区六町2丁目. Using <a href="http://nice-map-urls.herokuapp.com/japan/tokyo/adachi/rokucho/2" rel="nofollow">http://nice-map-urls.herokuapp.com/japan/tokyo/adachi/rokuch...</a> I get the right spot, but the search box doesn't seem to work for me(but I am behind a very high-latency line, it might be my connection that is borking)<p>second edit: seems that the resolution is around ward-level(even when searching romanised addresses like "2-10-3 Honkomagome, Bunkyo, Tokyo", a search which works in google maps) From an intuitive standpoint, there should be no reason for this not to work, there's nothing particularly weird about the address format. I dunno
评论 #5624658 未加载
评论 #5624642 未加载
paulsutter大约 12 年前
People are making great points about ways to improve the service based on the way addressss vary around the world.<p>Could we present these as helpful suggestions, especially including one or more examples based on our local knowledge? Rather than everyone piling on with dismissive one-upmanship?
评论 #5625027 未加载
评论 #5625168 未加载
buro9大约 12 年前
<a href="http://nice-map-urls.herokuapp.com/united-kingdom/greater-london/london/high-st" rel="nofollow">http://nice-map-urls.herokuapp.com/united-kingdom/greater-lo...</a><p>Whilst it is a nice idea to put textual labels in, and whilst it may work for grid-based cities such as those in the USA... it's really going to have a problem in Europe where many large cities are the result of growth over centuries and the merging of villages and towns into cities.<p>London has so much duplication in things like High Street, Church Street, Chapel Lane, Market Place... and the system outlined will just fail to disambiguate.<p>The only thing that could truly work on a global level is some geospatial identifier in the URL, with text that followed it. But then if the place itself was large it could span multiple geospatial points and result in duplication.<p>Duplication of URLs is probably better than ambiguity over what the URL points to.<p>PS: I tried to do a query on Open Street Map to discover how many High Streets there are in London but I hit the limit of their disambiguity service. And there are High Streets from one old village that have been extended to the point that they touch the High Street of another old village. 2 different High Streets with an almost identical postal code.<p>PPS: Perhaps a post-code? In the UK it's good enough to give someone a post-code and door number and you can get to their front door. How that would work globally I do not know... fine for most of the Western World, useless in India maybe, etc.
评论 #5624858 未加载
评论 #5624637 未加载
评论 #5624814 未加载
vdondeti大约 12 年前
I took another approach to this. I have been meaning to post it to HN for a while, though it is still a little raw. I call it geokode - <a href="https://geokode.com" rel="nofollow">https://geokode.com</a> - it is meant to be like bitly for location. You can essentially choose what your url should be for any location. This makes it very user-friendly and you can also brand your location link. Currently, you can only use English characters and numbers. I have pre-populated it with some entries (see examples below), but the goal is to get users to create their own 'geokodes' as I like to call them. I am also working on a API to make the location data available once the geokode is provided. You can even link a geokode to GPS coordinates, which will be especially useful in countries where addresses are not simple. Obviously, the site needs a lot more polish, but let me know what you think. It is currently free to register a geokode - I have to update the demo video.<p>Some examples to highlight use cases:<p><a href="https://geokode.com/*abckitchen" rel="nofollow">https://geokode.com/*abckitchen</a><p><a href="https://geokode.com/*disrupt" rel="nofollow">https://geokode.com/*disrupt</a><p><a href="https://geokode.com/*joneswedding" rel="nofollow">https://geokode.com/*joneswedding</a><p><a href="https://geokode.com/*dormroomfundhq" rel="nofollow">https://geokode.com/*dormroomfundhq</a><p>Also, I will be at TC Disrupt in NY today in the Startup Alley in the Mobile category. Feel free to come by.
评论 #5626172 未加载
dsl大约 12 年前
The biggest problem with geocoding is that not all places have addresses. Especially in the developing/third world.<p>It also lacks a lot of things I normally link friends to in Google Maps. For example when giving directions I always link to the street view of the main entrance.
评论 #5624649 未加载
评论 #5625536 未加载
konstruktor大约 12 年前
Just because your native language can be expressed in ASCII, your name can be split into a first and a last name and you live in a country with grid-like streets doesn't mean that internationalization and anything related to location is easy.<p>Apple learned it the hard way.
Sprint大约 12 年前
This might seem nice for the USA but it would fail miserably in other places (or require different URL schemes). I could not find a bigger discussion I remember on HN but <a href="https://news.ycombinator.com/item?id=2588289" rel="nofollow">https://news.ycombinator.com/item?id=2588289</a> might work as example already.
aidos大约 12 年前
I applaude the effort - but there are plenty of places where this falls apart. The most glaring I can think of is Nicaragua - where addresses are described based on landmarks:<p>Eg "From the Calvario Church, 1 block south, half a block east"<p><a href="http://vianica.com/nicaragua/practical-info/14-addresses.html" rel="nofollow">http://vianica.com/nicaragua/practical-info/14-addresses.htm...</a>
评论 #5624956 未加载
erikstarck大约 12 年前
Cool. I'm working on something similar: <a href="http://addressaddress.com" rel="nofollow">http://addressaddress.com</a> (be gentle, still work in progress). I've mostly tested it with Swedish addresses, so might be problems with US ones.
评论 #5624598 未加载
the_imp大约 12 年前
How exactly is this any nicer than what Google Maps already does?<p><a href="http://maps.google.com/maps?q=199+Valencia+St,+Mission+Dolores,+San+Francisco,+CA,+United+States" rel="nofollow">http://maps.google.com/maps?q=199+Valencia+St,+Mission+Dolor...</a>
Millennium大约 12 年前
It's a very nice-looking URL, but I'm not sure how practical it is. Although the idea that "Cool URLs don't change" is not explicitly stated as one of the core principles of REST, it is nevertheless important. But political boundaries and names do change: some more frequently than others, of course, but they all change in due time. If the URLs are not kept up-to-date, then the mapping API becomes a lot less useful, but it also becomes a lot less useful if they ARE kept up-to-date.
AlexeyMK大约 12 年前
Not quite as heirarchical as what you've got, but check out <a href="http://mapof.it/199-valencia-st-san-francisco" rel="nofollow">http://mapof.it/199-valencia-st-san-francisco</a>
ultimoo大约 12 年前
Nicely done.<p>I'd love it if it also supported modifying the URLs, since they are so readable. For example, if I delete the 199 from the end of your URL [1], it should still show me Valencia St. on the map. However, in its current state, I don't think the app parses any incoming URLs from the location field.<p>[1] <a href="http://nice-map-urls.herokuapp.com/united-states/california/san-francisco/mission-dolores/valencia-st/199" rel="nofollow">http://nice-map-urls.herokuapp.com/united-states/california/...</a><p>[2] <a href="https://maps.google.com/maps?q=199+Valencia+Street,+San+Francisco,+CA&#38;hl=en&#38;ll=37.769951,-122.422264&#38;spn=0.011975,0.02178&#38;sll=37.770189,-122.422435&#38;sspn=0.011975,0.02178&#38;hnear=199+Valencia+St,+San+Francisco,+California+94103&#38;t=m&#38;z=16" rel="nofollow">https://maps.google.com/maps?q=199+Valencia+Street,+San+Fran...</a><p>[I attached google's original link just for reference]
评论 #5624622 未加载
评论 #5624782 未加载
barryhunter大约 12 年前
Google Maps have tried this, I guess it failed, because it no longer distributes such urls, but for the most part the old links still work, eg <a href="https://maps.google.com/places/ca/bc/nanaimo/wallace-st" rel="nofollow">https://maps.google.com/places/ca/bc/nanaimo/wallace-st</a> or <a href="https://maps.google.com/places/uk/london" rel="nofollow">https://maps.google.com/places/uk/london</a><p>In fact the 'example' url pretty much works<p><a href="https://maps.google.com/places/united-states/california/san-francisco/mission-dolores/valencia-st/199" rel="nofollow">https://maps.google.com/places/united-states/california/san-...</a><p><a href="http://www.jasonbirch.com/nodes/2009/09/24/365/google-place-pages-indexable-not-really/" rel="nofollow">http://www.jasonbirch.com/nodes/2009/09/24/365/google-place-...</a>
alessioalex大约 12 年前
Btw it's cutting out some special chars to make the url pretty. Test this: Pitești, Argeș, Romania
评论 #5624517 未加载
fsniper大约 12 年前
Why everyone is trying to make this to work for every address available over the world? Why not just let it work for where it can work for and then iterate? What happened to the MVP idea?<p>This is a clever and intuitive idea. Nice work ;)
habosa大约 12 年前
That is a very nice demo and those are very clean and readable URLs. However I'm not sure how useful it is because I think one of the main advantages of human readable URLs would be making a scheme that I could generate by hand from an address I know. I think this scheme requires too much information, specifically in the "neighborhood" part. I didn't even know what to put between the city and the street in my own home address.<p>I like the suggestion here: <a href="https://news.ycombinator.com/item?id=5625126" rel="nofollow">https://news.ycombinator.com/item?id=5625126</a>
joeblau大约 12 年前
I wrote a speed trap application a few years ago and I used this similar structure for speed trap locations. eg<p><pre><code> http://www.vroomtrap.com/speed-trap-list/united-states/california/san-francisco/1900-mission-st-san-francisco-ca-94103-usa--VT144-2 </code></pre> While that scheme works well in the US and in English, some other countries/languages can't follow that pattern consistently. You'll also run into name collions that will break your scheme. I had to add a unique ID at the end of every address just to make sure I didn't get address collisions.
NelsonMinar大约 12 年前
Google Maps URLs could sure use some help. But I don't know that street addresses are a great naming system. If you want to use lat/lon, many open source tools like Polymaps, ModestMaps, and Leaflet (with the leaflet-hash plugin) support updating the URL automatically on navigation. (No "click here for URL"). For example, here's a clean URL to a map app that describes the base layer, zoom, and lat/lon: <a href="http://maps.stamen.com/#toner/12/37.7706/-122.3782" rel="nofollow">http://maps.stamen.com/#toner/12/37.7706/-122.3782</a>
dbg31415大约 12 年前
Remind me again what the point is?<p>I think this takes an incredibly narrow view of addresses.<p>Many times they aren't just a number on a street -- one street can go by multiple names, one street can have multiple identical numbers (seriously try living outside of the US for a while). So what Google does is allow for flexibility. And it works. Quite well. It's not perfect, but that's because the real world didn't have an IA or DBA designing it.<p>Also, all those / can't be good for SEO...
rmc大约 12 年前
Now make it work internationally.<p>Good luck with all the address formats and disagreements about addresses (and places like Ireland where the address can be in either language).
评论 #5627120 未加载
rocky1138大约 12 年前
I get this in the JS console:<p>[blocked] The page at <a href="https://nice-map-urls.herokuapp.com/united-states/california/san-francisco/mission-dolores/valencia-st/199" rel="nofollow">https://nice-map-urls.herokuapp.com/united-states/california...</a> ran insecure content from <a href="http://maps.googleapis.com/maps/api/js?libraries=places&#38;sensor=false" rel="nofollow">http://maps.googleapis.com/maps/api/js?libraries=places&#38;...</a>.
raverbashing大约 12 年前
Stop it.<p>I know, nice idea, 'REST' etc, good looking.<p>Stop it.<p>As all the other comments stated, this will break down around the corner.<p>Country name. How do you locate a point in the ocean? What about Österreicht (easy level). ประเทศไทย (hard level)<p>State name. Not all countries have states. Or they're not used day to day. So in case of Ireland, do I put 'Dublin' or 'Leinster'<p>'Mission-dolores'? Street name? Street number?<p>Oh and by the way, the street numbers match the google maps position <i>if you're lucky</i> (it's getting better)
评论 #5625109 未加载
评论 #5625180 未加载
gojomo大约 12 年前
I'm reminded of Derek Sivers' post about Japanese addresses:<p><a href="http://sivers.org/jadr" rel="nofollow">http://sivers.org/jadr</a>
sghill大约 12 年前
Nice work on an interesting project! Google Maps' urls were always hideous for sharing before they introduced the shortener.<p>Maybe worth noting? I opened this up in Firefox (Aurora) for Android, which changes the URL bar to show only the page title until you tap it.
dexcs大约 12 年前
I like the clean interface more than the clean url :) Google should look like this...
mtgx大约 12 年前
I wish Google would improve their Google+ url's, too, now. Are they still allowing to choose your own vanity url, or did that work only for a limited time period last year?
TillE大约 12 年前
You got Berlin right and even split Kreuzberg off from Friedrichshain-Kreuzberg. It's a little buggy and your URLs should probably convert ß to ss, but I'm impressed.
评论 #5624862 未加载
kaoD大约 12 年前
<i>Paseo de la Estación</i> turns into <i>paseo-de-la-estacin</i>, which is not very pleasant.<p>Don't just strip these! <i>paseo-de-la-estacion</i> would be better.
magicor大约 12 年前
This seems somewhat simpler <a href="http://mapa.arredemo.org/" rel="nofollow">http://mapa.arredemo.org/</a> Anyway they both feel nice.
kidsil大约 12 年前
Directions might be tricky as the URL will become a lot longer (especially if you're giving directions to multiple locations)
fractalsea大约 12 年前
I loved the full screen-ness of it!
DivisibleByZero大约 12 年前
It's always bothered me that Google doesn't have pretty URL formating. Well done here.
vassilevsky大约 12 年前
Good job on the URL and on the site as a whole.
rmhrisk大约 12 年前
Cool, I would love to see the source.
评论 #5624562 未加载
mnml_大约 12 年前
Google isn't so good at SEO ? ;)
jakozaur大约 12 年前
Nice, but I would make it realtime:<p>.../#united-states--california--
评论 #5624510 未加载
FailMore大约 12 年前
Fantastic.
tuananh大约 12 年前
the whole thing is all about human-readble URL debate.
badkangaroo大约 12 年前
i love this.