Map Scripting

Icon

Create Location-based Web Applications

Book Progress: 75% Done!

I’ve had my head down writing and I’m seeing the progress. Of the nine chapters currently planned (that number may change), I have written all or most of seven of them. That means I’ve nearly written a book!

Now my plan is to sprint through the bulk of what remains during August, leaving just a few bits to finish up after my wedding.

Several people have asked me when my book will be out. Thank you for your interest! I don’t know–there’s a lot to be done even after my writing is finished. However, I now have a handy form in the sidebar of this site. If you’d like word of when the book is out, visit the main page and fill in your email address. I won’t do anything bad with it, I promise.

Weather, Earthquakes and Concerts — Example Mashups

Cloudy in MiamiI’m totally stoked to have finished the first draft of a really big chapter for the book. Mashup with Data APIs will show at least three example mashups that I think will help beginners learn how to incorporate outside data and create interactive maps.

  1. My Weather mashup shows the current conditions across the U.S. and provides the forecast when you click an icon.
  2. My Earthquake Mashup shows the earthquakes in the world over the last week, with marker size increasing with the quake’s intensity.
  3. My Upcoming mashup shows concerts happening in the next week by location, with filtering by ticket price.

If you’re new to mapping, get a feel for how it works by viewing source. On the other hand, if you’re a JavaScript expert, tell me what you would have done differently. In either case, I’d love to hear feedback!

Yahoo Calls Hurricanes “Windy”

Yahoo icon for hurricaneI’m working on some mashups for a chapter in the book, including a weather map. So, I was checking out Yahoo’s weather API and came across its codes for specific conditions.

Curious, I started cross-referencing the codes to their icons. Most are able to get across the condition visually. A few, such as dust and fog, require text to make sense of what would just be a picture of haze. Actually, haze is its own condition.

Another that also gets textual treatment is hurricane. But instead of tossing the H-word into a graphic of sideways rain, Yahoo’s icon simply says “WINDY.”

Weather Channel hurricane iconSeems like an understatement to me.

The data comes from the Weather Channel, but its icon of the same code has no text. And it looks scarier, much more appropriate for a hurricane.

Tweaked Some Mapstraction Functions

There’s nothing quite like teaching to help you figure out what you don’t know. I’ve been detailing the basics of mapping–plotting markers and adding click-able message boxes. Through the process, I’ve discovered a few holes in Mapstraction‘s coverage of common API features.

For example, there was no method to programmatically close a marker’s message box. You can open it with openBubble, but closeBubble didn’t exist.

Similarly, panning to a new center point, a feature in most mapping providers, was absent in Mapstraction. It’s a nice-to-have, but it sure is less jarring when switching to a point near your current view.

I was faced with the possibility of either leaving them completely out of the book, or implementing them in provider-specific code. Neither seemed like a good solution. So, I set the book to the side and decided to implement them myself.

I’ve been a programmer for well over a decade and I’ve taken advantage of many an open source project. Never before had I contributed code to one. Lucky for me, there is a loyal group of Mapstraction contributors willing to help out a newbie. My “patches” (calling them such is kind, since I merely pasted code into the discussion list) were quickly accepted and are now part of the code repository. Sweet!

Now it’s back to writing. Chapter three is days away from being complete!

Finished Chapter Two

Today I celebrated a milestone by completing a draft of the first chapter of my book about online mapping. Now it’s off to my editor, who I expect to have a double helping of constructive feedback.

Incidentally, it was chapter two that I finished first, skipping chapter one. Teacher always said to write your introduction after you’ve written the conclusion.

Chapter two covers the mapping APIs discussed in the book and makes a case for Mapstraction, which I plan to use wherever possible. I also give some basic examples, like adding controls to the map and setting the zoom level.

I’m still just getting started in the global perspective of the book, but it feels good to pass a big ol’ psychological checkpoint.

Adam DuVanderHi, I'm Adam. I'm writing a book about developing maps on the web. This site is where I'll share the things I find and help you create your own maps. Find out more.

Map Scripting 101