A Curious Animal

Born to be curious, born to be animal!

The Book of OpenLayers 3, completed !!!

16 December, 2014
- 1 min read

It was a long road but finally it comes true: The Book of OpenLayers 3 is finished. The chapter Controls and Interactions concludes the exploration of the main concepts related with OpenLayers version 3. This chapter is focused on showing how to work with the two main tools necessary to interact with the maps and its contents. New samples have been created. Remember the source code can be found at https://github.com/acanimal/thebookofopenlayers3 and a running demo is available at http://www.acuriousanimal.com/thebookofopenlayers3/. I must admit finished is not the best word to apply, OpenLayers3 is big, complex and awesome enough to write tons of chapters, but I must put a final dot and leave the typewriter... for a while :) Some of you have contact to me notifying spelling errors. I have given priority to the release of the final chapter. Please don't hesitate to contact me to notify me more error (or anything), my next release will be a maintenance version fixing all that errors. Many of you has suggested me many ideas on features to write about, so I think I will come back with a "There is more" really final chapter some day. Thanks for your confidence.

Things to know when writing a book

15 November, 2014
- 2 min read

From my short experience, let me summarize some things you must take into account when writing a book. Its is not a mechanical process, it is more related with inspiration, but we must be constant and productive. Everyday is not the best day to write It is a fact, a law of universe. You could desire write but some days your brain is not clear enough, agile enough, fresh enough to write as you like. Don't force yourself. Don't hate yourself to be unable to write as you would like. Relax. Disconnect. Put your head in another tasks. Do some sport. The best thing to do when today isn't the best day to write is not to write. Markdown notation is great Yes, markdown syntax is great. It is simple, clear and powerful. At the beginning, if you come from a complex word processor like Word, Pages, LibreOffice or similar, you feel nude, but later you will appreciate that nudity. Markdown separates your raw writes from the final visualisation. A text editor is enough People tend to drown looking for the perfect tool to make the work. My advice is don't bother you, a simple text editor is enough to write any kind of book (otherwise ask to the hundreds of people that have written using a typewriter). Personally, I prefer a simple text editor over a word processor, because the first isolates the content from the way to visualise it. Of course technology can improve the way we work. We have tons of text editor, classics like vim or emacs text editors, the new ones like SublimeText, TextMate or the Ulysses application, and also, many online text editors, like dillinger.io or StackEdit. Keep cross references organized Some kind of books, like technical books, are plenty of cross references pointing to other sections, chapters or samples. It is vital for the author to maintain these references updated and organized. When using markdown a tend to organize the book as follows: Each chapter in a separate file named  Put a reference on each chapter title like: Put a reference on each section title as These simple tips help you organize the whole book references and simplifying the process to create cross references.

New Overlays chapter on The Book of OpenLayers3

02 November, 2014
- 1 min read

The Book of OpenLayers 3 has been updated !!! This book is self-published, no great editorial is behind it neither a marketing campaign, so I appreciate any shares you can make through social networks and any other media. What you can find in this new update? A new Overlays chapter. This is a short but necessary chapter that explains how we can work with overlays to place any kind of HTML located within the map. As I comment, it is a short chapter but I prefer to leave it as an independent chapter. A new sample on the Events, listeners and properties chapter, named Styling features under the pointer. Once we know about feature styling and events, the sample demonstrates how we can change the style of the features under the pointer. The book has now 6 chapters and is 80% complete. Currently I continue working on a more extensive chapter called Controls and Interactions, which I hope to have finished in approximately a month. Please, don't hesitate to contact me with comments and suggestions. Your feedback is really valuable for me. Thanks for your confidence in The Book of OpenLayers 3.

7 reasons to use Yeoman's angular-fullstack generator

18 October, 2014
- 3 min read

For my next project and, after looking for candidates and reading some hundreds of lines of documentation, I finally choose to work with the so called MEAN stack: mongodb, express, angular and node. As with any other technology ecosystem, the great number of frameworks, libraries and tools can make our choice a challenge, and JavaScript is not an exception. But for JavaScript projects we have lot of help and I decide to use the awesome Yeoman tool. Yeoman combines the power of grunt, bower, npm and adds its own salt: the generators. Yeoman generators are tasks responsible to build the initial project scaffolding. Yeoman offers an extensive set of official generators oriented to create: webapps, backbone app, chrome extension, etc but we can also found a myriad of non official generators (yes, because anyone can create a new generator to satisfy his/her needs). Within all the generators I chose angular-fullstack to create my MEAN project structure and next are my reasons: 1. Easy to install You require to have node and npm installed on your system. Once you have them installYeoman and the angular-fullstack is as easy as: Once installed the generator you simply need to create a new folder and initialise your project: {% highlight bash %} mkdir my-new-project && cd $_ yo angular-fullstack app-name {% endhighlight %} 2. Creates both client and server scaffoldings The generator generates the full stack of your project, both the client and server code. Your project will start well organised and prepared to create an awesome RIA application. 3. Introduces good practices in the generated code Because the generated is made by experienced developers, they applies good practices in code organisation and style programming (like the environment configuration on the server side using node). For me, this is one of the most important reasons to use this generator. Anybody knows starting with a new technology is always hard, but it is nothing when you start with four new technologies :) 4. Server side API prepared to use authentication Following best practices the code is prepared so you can easily add security to you API via a node middleware so each request requires authentication of the client side. 5. Support HTML or jade templating on client side You can use any template engine for client side but by default the generator works with HTML and Jade. I don't really like Jade too much so I always try to use EJS or similar (Warning this last sentence is the author's opinion). 6. Support for different CSS preprocessors For different opinions there are different alternatives. This way angular-fullstack has support for plain CSS, Stylus, Sass or LESS pre-processors. Choose your preferred. 7. Commands to scaffold anything With theangular-fullstack you can create new end points for the server side or client side components (like routes, controllers, services, filters, directives, ...) with a sentences. So, next command: {% highlight bash %} yo angular-fullstack:endpoint message ? What will the url of your endpoint to be? /api/messages {% endhighlight %} will produce: {% highlight bash %} server/api/message/index.js server/api/message/message.spec.js server/api/message/message.controller.js server/api/message/message.model.js (optional) server/api/message/message.socket.js (optional) {% endhighlight %}  Conclusion In my opinion, angular-fullstack is a really powerful tool that simplifies our day to day work. As always it is not the panacea, it is simply a generic tool to automatize many common tasks. Because of this we can found situations it lacks some feature.

The Book of OpenLayers 3, released !!!

08 October, 2014
- 2 min read

Finally I completed most of the chapters I had thought for the book. Although two chapters remains to be written, I think the current content is extensive enough to help anybody interested to lean this great new version of the OpenLayers project. The current chapters explains: The map and the view Layers Data sources and formats Vector layers Events, listeners and properties The two remaining chapters I have in mind are: Controls and interaction Overlays Hope, this book help you to introduce to the OpenLayers version 3. Remember, thanks to the LeanPub platform, when you buy the book you can get any later update I make on it. In addition, you have 45 days for refund if you think the book does not cover your expectations. In addition, don't hesitate to contact me for any errors, misspelled words or sentences, etc. Remember, this is a self-published book. No main company is behind it and no great marketing campaign is prepared. Any help from you, talking about the book at any forum or social network will be appreciated. Finally, I would like to thank my wife, Pilar, for her understanding and almost infinite patience for my job, hobby and profession, the computer science.

Announcing the release of The Book of OpenLayers 3

23 September, 2014
- 2 min read

I just sent this words to all the people interested in the book via LeanPub and I would like to post it here too, hoping this message arrives to more people. The Book of OpenLayers3 is progressing well. It is not finished but I would like to notify you, in the next weeks, I will launch a pre-release of the book. At this moment the book contains five chapters covering the most important topics of the new architecture and design of the library. All chapters are divided in a theory section, where I explain all the concepts and involved classes, and a practice section, where I show real working examples. Remember, all the examples are also freely available at the GitHub repository: https://github.com/acanimal/thebookofopenlayers3 are right now running at: http://www.acuriousanimal.com/thebookofopenlayers3. My intention is continue writing, at least, two more chapters. One dedicated to the controls OpenLayers3 offers to interact with the map, and a second one, related to the concept of overlays. I hope to cover these two chapter in one month. Thanks to LeanPub platform, once you buy a book you are allowed to download the new updates freely. I will notify you when new releases are available. Please, do not hesitate to send me your feedback related with the book, from its content to its costs. Finally, remember this book is self published, no great publishing company is behind it and no great marketing campaigns are organised, so any comments on shared networks that publicise the book will be appreciated. Antonio Santiago (@acanimal) - #thebookofopenlayers3