43

In reference to this question: Data layer not responding in event listener (Google Maps API) .

I posted this yesterday, trying to figure out a logic issue in the Google Maps API where I was trying to manipulate a geoJSON layer that isn't quite binding to the map. I gave a clear description and history of the problem, which errors I was getting, and what I had tried. However, it got downvoted twice almost immediately, citing incomplete code.

The thing is, I've tried to reproduce this in a JS fiddle. The app has multiple developers, refers to outside sources (geoJSONs), and won't render in the JS fiddle when I set it up anyhow - laying out the logic seems to be the clearest and most concise bet. (I've expanded the amount of the JS file since then - it seems excessive.)

Is there better way to format a Google Maps question? I'm obviously new to the industry, but this issue seems to only crop up to this degree when I ask about their API. (I work mainly in Rails, which has a great community on here).

Edited because I had to delete and repost the question. People were reaching into the question on a previous related question and downvoting that as well. I haven't been here long and have limited points to lose.

2
  • 1
    Just as an aside, it's likely a bad idea to delete and repost a question because it's being poorly received. Downvotes on questions still count against you even if they're deleted, and if you delete too many negatively received questions rather than editing them to improve the originals, you risk being blocked from posting further questions in the future.
    – Sam Hanley
    Commented Apr 26, 2018 at 15:34
  • Yeah, I agree. Generally I edit, that mostly came out of a moment of frustration, heavy rewrites and wanting to start fresh on that question to stand alone.
    – Boucherie
    Commented Apr 26, 2018 at 15:40

1 Answer 1

38

User geocodezip posted comments on my question to help me pull my question together into a verifiable format:

You can make small (valid) GeoJson snippets (one city, one county, one district), load them with addGeoJson (rather than loadGeoJson), since loading the geoJson isn't the problem.

This made a huge difference - the external files were a large part of my roadblock in getting anyone to look at this question.

1
  • 2
    You should accept your own answer
    – River
    Commented Apr 26, 2018 at 1:15

You must log in to answer this question.

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