Potlatch 1/Development overview/FAQs

From OpenStreetMap Wiki
Jump to: navigation, search

If you have a question about how anything in Potlatch works (or doesn't :) ), please ask Richard. Until then:


Are there any ActionScript gotchas?

ActionScript 1 is a really predictable, friendly scripting language. If you've ever used JavaScript you'll find ActionScript wonderfully tolerant in comparison.

There are a very few gotchas you might want to be aware of:

  • Generally you don't need to worry about typing, but AS1 is not quite as DWIM as (say) Perl. Movieclip names are strings, and so are any variables passed by JavaScript to the SWF. Consequently you will need to coerce them into numbers if you want to do anything useful with them. Use Number(var) to do this.
  • Looping through hashes never works quite as easily as you expect. You may need to assign the hash to a temporary variable and loop through that instead. For example:
 z=this.path;
 for (i in z) {
   if (_root.map.pois[this.path[i][2]]) { removeMovieClip(_root.map.pois[this.path[i][2]]); }
 }

WTF?!!?!1!1

Potlatch is Flash which is Unfree, the code isn't very OO, what's with this AMF stuff, it's not XML, my head hurts, the code has tabs and weird indentation, global variables didn't they go out in 1973 or something lol, you must licence all your stuff under the GPL all other licences are teh lame, it talks directly to the database rather than via the Rails object model OMG have you never heard of MVC, you could do all this in AJAX and SVG and you would only need a 972k abstraction library, yadda yadda yadda.

Yeah, well spotted. Have a medal.

If some of this matters to you and you think it'll make a material improvement to the end-user if you fix it, go ahead.

But given that the end-user doesn't actually care about transport formats or source tab style then please don't just change something for the sake of it. The end result of this will simply be that it confuses the lead developer (who is still a bit upset that you can't program the web in Locomotive BASIC and Z80) who will have to spend more time learning not-entirely-necessary skills, and less time coding stuff for mappers to use.

If you have ever used the word "methodology" then Potlatch is almost certainly not the project for you. Fortunately we have lots of others. :)

Also see Developer community etiquette which says the same sort of thing, and read up on the concept of système D:

It's not only how the French get things done in a system loaded with complexity, this approach is a way to not feel suffocated. [1]