10

My question How to use Google Map URL as a marker Google Maps? was closed with feedback "off-topic because it's seeking recommendations for books, software libraries, or other off-site resources".

But nowhere am I asking for a software recommendation. I was asking how to do something with a specific library, the Google Maps JavaScript API. In other words, in my opinion the question was "a practical, answerable problem that is unique to software development", and "a specific programming problem", two of the criteria.

It may well be that the answer is "No, you currently can't do that with the Google Maps API", and if that answer seemed reliable I would have gladly accepted it, as negative confirmation helps me avoid wasting time.

My question seems like a pretty concrete programming question. I'm trying to do something in this specific API, I tried a lot of things and couldn't find out how, so I'm asking if someone else knows how. Sometimes people know of undocumented functions in APIs, for example. I'm not asking anyone to recommend a different API.

However, multiple reviewers voted to close it, so obviously this intent didn't come through. Could I make any edits to make the question clearer, to pass review? It is more for my education; I don't even mind if the community thinks the question should stay closed.

10
  • 7
    Yeah, some users are too quick to pick that close reason on anything that remotely resembles an off-site resource request. I believe that was wrong in this case. On the other hand, you said "I've written some code that fetches the URL and [...] It only works about 20% of the time" but you never included that code in the question. This makes the question close-able for one of two reasons: "Needs more focus" or "Needs debugging details".
    – 41686d6564
    Nov 15, 2022 at 14:41
  • 7
    While I would not have voted to close this question as seeking recommendations, I am having trouble seeing the programming problem in it. Just from the question it's not even clear to me this is concerning "the Google Maps Javascript API". Nov 15, 2022 at 14:45
  • 2
    I voted to close and I'd vote the same again. What you can do with Google Maps URLs is depicted in the documentation. Any attempt at reverse engineering these URLs is undocumented. I would also close it as Unclear and Needs debugging details (and maybe too broad). Why not share your code if you have something already? Why do you state I don't care about lat/lng? This just doesn't clarify anything. asking a customer to send their latitude/longitude is not very user-friendly - how about doing it differently? What will happen to your code the day Google changes these URL schemes?
    – MrUpsidown
    Nov 15, 2022 at 19:11
  • 1
    So it looks like I should have limited the question to just what I wanted to do (namely, place markers on a Google Map using an address URL), instead of adding details about workarounds I tried before reaching out for help (extracting the latitude/longitude from the address URL). The un-posted code referred to that workaround, the reverse engineering referred to by @MrUpsidown, which is exactly why I didn't post it. But the very fact so many are referring to that code helps me understand why my question was unclear.
    – royappa
    Nov 15, 2022 at 19:26
  • I have edited my original question to remove irrelevant details which were obfuscating my actual question. Will wait to see if it passes review to reopening. Regardless of that, all the answers and comments here will help me write better questions in the future. Less is sometimes more!
    – royappa
    Nov 15, 2022 at 19:36
  • TBH I would not vote to reopen. Now it's clearly too broad.
    – MrUpsidown
    Nov 15, 2022 at 20:17
  • 1
    I should have limited the question to just what I wanted to do - yes, and no. Don't include noise and irrelevant info but show what you have tried and tell us what were your attempts at solving the issue by yourself. Otherwise it sounds like you haven't put any effort in researching a solution, which at least deserves a down-vote and likely a close-vote for being too broad.
    – MrUpsidown
    Nov 15, 2022 at 20:33
  • @MrUpsidown (and others) all points noted, will learn and move on. Now, what should I do with THIS question? The accumulated comments are as useful as the two posted answers. Should I randomly pick one? Leave it unanswered (which seems sloppy)?
    – royappa
    Nov 16, 2022 at 0:37
  • 1
    I agree that the original closure was off. But I can't imagine that this question would have ever landed well. The original version of it has a magical combination of two hip fire triggers: no code and web scraping. And then the final nail in the coffin: you made the web scraping the meat of your question. Even though that is actually a means to an end you picked yourself, it is not the actual problem you want to solve. So that makes it an X/Y problem. Effectively the question was written so only hardened Stack Overflow veterans could defeat it.
    – Gimby
    Nov 16, 2022 at 14:46
  • @MrUpsidown I posted another question (stackoverflow.com/questions/74535644/…) hoping to have learned something from this discussion, but that too has 2 votes to close. Would you mind commenting on that question with any suggestions to improve it? (I don't feel like I should open another discussion on Meta for that question).
    – royappa
    Nov 27, 2022 at 18:12

2 Answers 2

12

Yes that close reason doesn't make any sense - it seems that the wrong close reason was used. But regardless, you write:

I've written some code that fetches the URL and parses the output to find the latitude and longitude (following redirects, etc.). It only works about 20% of the time;

This code should be added to the question - you have written code which doesn't work as expected and you wonder why. That sounds like a legit troubleshooting question which is on-topic for SO. You could include relevant parts of the code in your question and add the corresponding programming language tag. If you edit your question it will pop up in the re-open review queue.

What's not on-topic however is "how do I implement my whole big project: here is a brief specification". Or "do you have any tips or general recommendations related to this project". Such questions will get closed as too broad.

2
  • 1
    I believe it does make sense. Now, after editing, the final question is : How do I place these address URls as markers on a map, using the Google Maps Javascript API? - if OP would read the official documentation, they would find out that there is no way. I close a lot of google-maps related questions for that reason. If people would do a quick search in the docs they would find their answer. But they don't.
    – MrUpsidown
    Nov 15, 2022 at 20:38
  • Well, I did RTFM, but (at least for me), it's a large API. So I asked the community just to make sure I wasn't missing anything, and sometimes you learn of undocumented functions which later become official. I did quite a bit more than a quick search, FWIW.
    – royappa
    Nov 16, 2022 at 0:34
5

I think most of us agree that this is the wrong close reason and that it shouldn't have been used here. I however don't fully agree with Lundin's answer and 41686d6564's comment that the question is off-topic regardless.

Being able to programmatically place a marker based on a URL that points to a specific location is something that I can see being useful to others. Especially for a tool that is so commonly used on the web. For that reason I believe this to be a valuable addition to our repository of questions and answers.

I agree that implementing a whole big project is off-topic on Stack Overflow, but this is rather specific and shouldn't require an answer the size of a book. It is either possible in a (somewhat) standardized way, or it isn't.

Having written code that only works 20% of the time is irrelevant. Adding the attempted code will put the focus on what is wrong with the code instead of the best solution to the problem. The latter has the most value for Stack Overflow as a Q&A repository.

4
  • 2
    Choosing the right office chair is something that I can see being useful to many developers. I do not think a question about that would be well-received on Stack Overflow though.
    – 41686d6564
    Nov 15, 2022 at 15:40
  • 2
    The point is: Just because something is useful doesn't mean it can't be off-topic. Now, admittedly, the OP's original question is not inherently off-topic, but it can certainly be improved to meet the guidelines.
    – 41686d6564
    Nov 15, 2022 at 15:42
  • 4
    "The point is: Just because something is useful doesn't mean it can't be off-topic." - I never claimed that. But the first and foremost goal of Stack Overflow is to be a repository of high quality questions and answers. Having all kinds of things in the question that distract from the actual problem subverts from that goal. That's the same reason why we edit out "thank you"'s and other taglines. (Assuming you refer to the code that works 20% of time time,) Who will benefit from that code being added to the question? As long as the question is clear and specific, the code shouldn't add value.
    – Ivar
    Nov 15, 2022 at 15:57
  • 1
    Meh, the project would have many subtasks, including but not limited to: establishing that an URL refers to one or more locations on Google Maps, trying to parse the location, noting Google Maps URLs can refer to entities that may change location, may have had a location on time of generation but not any more or have many locations, then determining the latitude and longitude of these locations when available. If there's not a simple standardized way to do so, this could well require hundreds of lines of code to do properly, however, I'm not particularly experienced in this subject
    – Erik A
    Nov 16, 2022 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .