Skip to content

More details on moving away from Google Maps

Well, our move from Google Maps to MapQuest is pretty much done (the start was mentioned here), so I thought I’d give a more exhaustive overview, including some more insight into our thinking.  For context, we, in this post, refers to 8z Real Estate, a real estate brokerage with a great website that drives a huge chunk of business.  (Of course, errors and opinions expressed here are all mine.)

First, if you are considering switching from Google Maps, definitely think about not leaving!  Depending on your customizations, it can be a real pain.  You can also think about it in terms of spending dollars with Google or spending dollars with your developers.

A good place to start is to make sure you know how many map views you are using.  I found three good ways to do this.

  • estimate using your web analytics tools (page A uses 1 map, and is viewed X times a day, page B uses two maps and a streetview and is viewed Y times a day).  This has the benefit of being free and in your control, and not requiring you to make any code changes.  It has the detriment of being imprecise, especially if you are displaying maps via javascript that might not be tracked by your analytics tool.  I used six months of our highest traffic days to get a feel for maximum map views per day.
  • ask a Google sales rep.  This has the benefit of being very precise–they can tell you how many map views they recorded for you on a given day, and, again, doesn’t require any code changes.  It has a number of downsides, though.  First, you have to get ahold of Google sales (using the ‘contact sales’ button here).  I had to submit this form at least twice before I got a call from them.  Second, you have to interact with a live person.  And third, they only have information for a single day.
  • install the new Google Maps API key and look at the API console.  The upside to this is that reviewing your usage doesn’t have any external dependencies and the console  is very precise in tracking your usage.  The downside is that you are now on Google’s radar, and it may require a bit of work (depending on when you added Google Maps to your site).

We actually ended up using all three of these methods at different times, but found the API console to be the best option long term because it is the most accurate.

Once you’ve found your map view usage, check out the usage limits, which will inform your decision.  Two other considerations before you decide to move off the free Google Maps.

  • If you have used the free Google geocoding service, you should re-geocode all your points, as it is outside the terms of service to display these points anywhere other than on a Google map.
  • It is unclear to me when they will start the clock on the new usage limits (as announced here).  I read the new terms carefully, and you have a grace period of three months (you have to be above the free limit for three months straight) before charges start.  Note however, that once you are over for the grace period, you never can get back into it (100 days of over 25K usage followed by 3 years of under it followed by 1 day over it will still result in charges for that 1 day overage).  Additionally, Google will give a months notice of the usage limits enforcement on the Google Geo Developer blog.  That means that you’ll have at least four months of lead time.  And note that they’ve moved the enforcement deadline at least once.

Ok, you’ve decided that it simply isn’t worth the risk, and that you need to take action to avoid being charged for Google Maps lickety split.  If you haven’t, godspeed.

The options for avoiding being charged are outlined very clearly:

  • Decrease your usage
  • Pay for a license
  • Pay for daily overages

Armed with your daily usage information (don’t forget to factor in traffic increases), you can see which of these options makes the most sense.  Contact Google enterprise sales if you feel a license purchase makes sense.  Be aware that the 25K daily limit works out to over 9M map views a year.  So if you are buying a license just to deal with daily traffic (as opposed to wanting the application to live on an intranet or some other non publicly available location, or a seasonal traffic spike), you’ll want to price out at least a 10M view license.

Once I got to talking to the Google representative, it became clear that the map license was pretty expensive.  The price range for a 30M license ranged from the mid 5 figures to the low 6 figures, per year.  We also looked at daily overages as an option.  Unfortunately this turned out to be hundreds of dollars a day.  Neither of these solutions made sense economically, so we decided to spend developer hours instead of dollars to decrease our Google Maps usage.

There are two ways to decrease Google Map usage, of course.  You can decrease use of maps all around (for example, by not having maps show up unless a user takes some action or removing extra maps), or you can migrate some or all of your current Google Maps to a different provider.

We tried both paths forward.  We removed some extra maps from the site (again, determined by our usage data), but that didn’t reduce usage enough, and also impacted users (as determined by email complaints!).

Therefore, we determined it was better to show the javascript maps every time.  We also had a technical wrinkle.  We use GWT  and are locked into Google Maps v2 (due to dependence on this library).  Google Maps v2 will no longer be supported in 2013.  I don’t believe there is a supported GWT binding for Google Maps v3, although that may get written later (here are two open source, non Google supported bindings that I found: http://code.google.com/p/gwt-google-maps-v3/ and http://code.google.com/p/gwt-maps3/ that may solve the problem for others).  Since v2 was deprecated on May 19, 2010, we knew we’d have to revisit Google Maps in the next year (by May 19, 2013, at worst), so that meant a hybrid solution (part Google Maps, part some other provider) was less appealing than otherwise.

We looked at a few different contenders to replace Google Maps.  Our criteria included:

  • quick to set up
  • accurate display
  • free for our usage leverl
  • close in features to Google Maps, at least the features we used
  • looked good

In the end, I prototyped three solutions that met the first four criteria above, and asked the team for feedback on the fourth.

The solutions included:

Some options that might be worth looking at for some, but didn’t work for us were:

  • Bing Maps, which we ignored due to license limits
  • Google Maps v3.  This version has significantly cheaper overages, so if you are right around the 25K usage, that might be worthwhile, but we were way over 25K mapviews, and also, as mentioned above, had GWT ties to v2.
  • Rolling our own maps (ht briantimoney).  I think this wasn’t the right solution for us two reasons.  One, we were looking for something that was a relatively easy ‘drop in’ replacement for Google Maps, and crunching a bunch of map tiles didn’t seem to fit that requirement.  Two, I’m not sure there’s a lot of value in unique maps for our real estate web application (though there is in having points of interest and accurate mapping of properties).

We ended up choosing the Mapquest Javascript API for the best look and feel.

The next step was to update the pages where maps were used.  There were two main types of pages that used maps.  One type of page showed a single property on a map.  The other showed multiple markers on a map, as results of a search.

The single property page was trivial to replace.  There were a couple of interesting wrinkles.  The first was replacing the default marker icon.  I had to tweak the iconoffset and shadowoffset properties of the icon object for correct display.  Additionally, the new map had to be displayable from GWT.  This required a JSNI method run in a deferred command, in order to make sure that the MapQuest javascript has loaded.

Based on map usage data, I was hoping we could get by just replacing the single property maps, but this didn’t decrease our map usage enough.  On to search results! (If you aren’t interested in GWT, you can skip to the bottom of this post, as the next section is all about GWT gyrations.)

Replacing the search results was slightly more complex.  I reviewed all the current code and categorize our existing GWT/Google Maps based functionality into three groups.

  • functionality that the MapQuest API could exactly replicate (putting a marker on a map)
  • functionality that the MapQuest API had an equivalent for (displaying information on click of a marker)
  • functionality that we had previously built but, in the name of simplification, weren’t going to port to the MapQuest based solution

After this categorization was done, it was fairly simple to port the needed functionality from GWT to javascript (jQuery/MapQuest).

One additional twist is formatting code shared between GWT and java (displaytag decorators, among other code).  The MapQuest javascript needed to be able to call that formatting code, as well as other GWT functionality (for example, creating a lightbox).  No sweat, right?  Here’s an example of calling GWT code from javascript.  The javascript that was calling the GWT code was running in a windows.load jQuery anonymous function.

Well, that worked fine in FF, and often in Chrome, but I was getting an error message from Chrome occasionally and IE all the time.  The Chrome error was pretty clear: ReferenceError: gwtListingUtilgetMLSIDLogoandOfficeName is not defined (gwtListingUtilgetMLSIDLogoandOfficeName is the name of one of the GWT methods that was exported for javascript to use).  The issue was that the map javascript was executing before the GWT code was fully loaded, and not finding methods it was expecting.

The solution was to chain the javascript, so that the map javascript was run via a GWT JSNI call after GWT was fully loaded, and all needed GWT functions were exported.  To provide for other GWT on load chaining, I used the onload pattern outlined here and created an addGWTOnLoadEvent.

Then I needed to create an anonymous function that GWT could call after it was loaded .  So, to recap the path of the map creation code (because it is kind of confusing to me):

  • on page load, addGWTOnLoadEvent(startupSearchMap()); where startupSearchMap returns an anonymous function
  • in GWT code, we export needed GWT functions to javascript: $wnd.gwtListingUtilgetMLSIDLogoandOfficeName = function(mlsId, source Id, baseImageURL, officeName, listingStatus, withBreaks) { return @com.cohomefinder.util.sharedwithgwt.ListingUtil::getMLSIDLogoandOfficeName(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)(mlsId, sourceId, baseImageURL, officeName,listingStatus,withBreaks);};
  • at the end of the export JSNI function, we call gwtonload: if ($wnd.gwtonload) { $wnd.gwtonload(); }
  • which executes the anonymous function returned by startupSearchMap which then binds to the DOM element and creates the map.  Needed GWT functions are guaranteed to be present.

This would all be a lot simpler if we didn’t have valuable code written in GWT, but that is a sunk cost that I don’t ever see rewriting.

After that, it was all just testing and making a few UI tweaks.  However, the depth and maturity of the MapQuest API and community scared me a bit, with forums that weren’t as deep as the Google Maps groups I had been accustomed too, and with posts like “IE9 not supported” by the latest MapQuest API.  The API documentation was also underwhelming, with plenty of methods undocumented.  But it all worked out.  If I was doing some aggressive, bounds pushing map functionality, I don’t know if these concerns would have been more of a hindrance.

So, to recap, if you are thinking about moving off of Google Maps:

  • find out your map views per day
  • consider usage solutions that allow you to remain with Google Maps
  • if you must move off of Google Maps, consider all other solution providers and find the one that fit
  • make sure you replicate your current functionality with the map provider you choose

In general, I would rather not have moved off Google Maps (it felt like running just to keep in place, and Google Maps is a great product), but the economics dictated this choice.  I hope this post helps you decide if moving off Google Maps is right for you.

Why you should blog

This is something I tell everyone I run into (because I think everyone has an interesting story to tell), so I wanted to outline my thoughts once and for all.

If there is any area of your life (professional life, hobby, future career) that you care about and of which you want to improve your understanding, you can do no better than to blog about the topic as regularly as you can.

Now, this isn’t the golden age of blogging, when you could be the only tailor/wine merchant/banker/etc blogging, and blog your way to fame, conferences, and riches.  There are countless blogs out there now (almost 1.3 million, according to technorati).  But you can still differentiate yourself from most by blogging.

I believer there are many many reasons to blog, but the strongest are:

  • you demonstrate tremendous credibility when you blog.  This credibility isn’t earned immediately, but after you invest some time (a year or so), you’ll have credibility when someone searchs for you on the web, or when you tell a prospective employer/customer/client “oh, I encountered that problem, let me send you an article about that” and you do.  A blog works for you even when you are sleeping–I’ve had random people contact me about a blog article, and I’ve had people I know say “I was searching for topic yyy and ran across your blog”.
  • you will learn more about the subject you are writing about than you thought possible.  I never know something so well as when you can explain it to someone else.  In addition, as you write post after post, you’ll find new dimensions to your subject, new people to interview (a great way to build content for your blog and to make connections), new questions to ask, and new organizations or companies relevant to you.
  • it is free, except for your time.  Other than opportunity cost and some thought, a blog doesn’t cost you anything.  This makes it a low risk marketing effort.

One bonus benefit: you own all the content you create!  Unlike what you post on twitter, which is ephemeral, or what you post on facebook, which is hard to export, most blogging software lets you import and export with relative ease.  There are services out there that will help you package your blog as a book.

Here are three objections that you may have to blogging.

  • Aren’t I giving my knowledge away for free? — Well, yes, if you solve the exact same problem that someone else has.  In my experience, it is much more likely that someone will have a similar problem, in which case your post is an advertisement for your services instead.  And if you solve someone’s exact problem and never see a dime for it, that’s good karma.  Now, I wouldn’t encourage someone to blog about a trade secret or an entire idea for which they are trying to get a patent, but they might blog about the process of getting there, or about a similar idea that they investigated but found lacking.
  • I can’t write — This is a two part answer.   One, you should get better at writing, since it is a key part of business today.  And practicing on a blog is one great way to do it.  Two, if you can’t write or don’t feel it is applicable to your skill set (you are, say, a photographer) and I can’t persuade you that it is *still* a good idea to write well, then you can blog using other media.  Video blogging, photo blogging and audio blogging are all options to which all of the good points I’ve made above apply, and none of them require you to write a word (I don’t have experience with those typs of blogging, but a quick search should help you find a platform).
  • I don’t have the time — Ah, finally, a good objection!  A blog does not have quick payback; it can be a year of writing a post every ten days before you get 20 visitors a day.  If you choose to invest in your career in another way (writing open source, if you are a programmer, toastmasters if you are a salesman, volunteering at a daycare if you are interested in childcare, etc, etc) I admire you.  I think these other investments shine in other ways, but they lack the scalability, reach and timelessness of a blog.  So, consider your priorities, and if blogging’s benefits aren’t enough to justify a time investment, I wish you well.

Ok, I have convinced you to blog, right?  Three next steps:

  1. Sign up for an account on blogger or wordpress.com.  Spend 10 minutes picking a look and feel and setting up an about me page, but don’t spend more than that.  It’s very easy to get obsessed with how your blog looks and ignore the content!  (You can always go back in six months and change your look.)
  2. Write your first blog post!  Don’t have it be an ‘about me’ post; jump right into the meat of what you want to explore, be it Tanzanian politics, the economics of ‘How I Met Your Mother’ or space technology.
  3. Decide how much time you want to spend on your blog going forward.  How much time should you devote?  Enough so that your blog is active, which I define as a post a week (your mileage may vary).  More if you have time.  Also, realize that you will have good months and bad months.  I’ve been blogging for over 8 years and have had months where I struggled to get one post up (and sometimes failed–I’m looking at you, November 2011), and others where I posted every other day.  I also suggest writing a bunch of posts when you have the time and/or urge.  These you can then schedule so that when you don’t have time, you can still be putting new content out there.

And a bonus step: find other bloggers out there, using Google or your search engine of choice, and comment on their blogs.  This brings you into a conversation and avoids ‘shouting into the wilderness’ syndrome of a blog that no one but you visits, which can be so disheartening.

Go do it!

Calling GWT code from javascript

There are lots of snippets out there on the internet telling you how to run GWT code from javascript.  Here’s the canonical one.

I recently did a fair bit of this, calling GWT code from jquery.  Two things jumped out:

  • Make sure your jquery method is run in $(window).load(), not $(document).ready(). If you use the latter, your GWT code will not have executed and exported the javascript method to the window object. More on that.
  • I couldn’t find a list of valid java type signatures (even in the JVM book) for the longest time, but here they are, at long last.

Update, 2/26: I ran into some issues with using $window.load().  What you have to do instead is create a gwtonload function and call it from your gwt loader via jsni.  This ensures that GWT code is fully loaded, which $window.onload() does not.

Using Munin To Track Business Values

Munin is a great piece of software that we use at my company to track overall trends in disk usage, CPU and other system purposes.  Now, we don’t have a ton of servers, so I’m not sure how munin scales for many machines, but it has been invaluable in troubleshooting problems and giving us historic context.

One thing we’ve started to do is to incorporate business specific metrics into munin.  This is good because it ties the technical operations more tightly to the business, making us aware when there are issues.

Anything you can run a sql query or do a wget for, you can graph in munin.  (Here’s something I wrote about writing munin plugins a year ago.)

I don’t think that munin is acceptable as a general purpose dashboard.  I’d probably look at Google Analytics if I was web drivingdriven (updated Feb 25 2012), and at statsmix if I needed to integrate a bunch of disparate services.  But for bringing additional business awareness to a technical team, writing a few custom munin plugins that will graph key business metrics can be very useful.

Hiring Tips

I’ve only hired a few times, but I just wanted to jot some notes about what worked for me in this process.

  • Use a bug tracker or issue tracker to keep track of resumes, emails and interactions
  • Respond to every person – there were some outsourcing firms that I didn’t respond to, but every other person got a response from me
  • Use Craigslist.
  • Use an email alias on your Craigslist post
  • Use other mailing lists (rmiug-jobs, cu cs jobs, even local neighborhood lists)
  • Ask your networks for candidates, but don’t expect too much of them
  • Pre-screen with a set of email questions if possible.  Don’t ask candidates to do too much, but asking them to do some work will allow some to self select out
  • When doing an interview, set the candidate up to succeed, by telling them what you are planning to ask them to do
  • Set deadlines for yourself, and share them with the candidates
  • Follow up with every candidate when you make a decision – I don’t think that it is fair to do otherwise
  • If you can point job seekers at another position, do so.  I recently did this with a QA position – in my search, I discovered another firm that was looking to hire, so I pointed all the candidates that didn’t work for us to that firms job posting
  • The web is full of sample job interview questions – use them!

 

Moving away from Google Maps

A while back I wrote about Google Maps charging.  This caused an uproar around many map dependent sites.   (Brian Timoney, ever reliable, delivers snark on that front.)

I, for one, don’t begrudge Google the chance to charge for their excellent product.  What that does, however, is make certain business models that were previously viable now unviable.  That is, if they remain with Google Maps.  In my previous post, I went over some alternatives.

The company I work for, after evaluating all the alternatives, including paying Google for a license, has decided to go with Mapquest.  While the API is not as gorgeously documented (both on the company site and on the web), it has the same licensure as Google Maps used to (free for any publicly accessible website), with much of the same base functionality.

I’ll be very interested to see how many people are doing such high value work with Google maps that they can afford to pay for licenses or per use.

On Being Disrupted

This is a tough post to write.  I’m at the tail end of an evaluation process for my company that ended up with us deciding to go with a third party vendor for software which powers key area of our business.  It is augmentation rather than replacement, but still.

It was hard for me, because this particular key functionality was previously provided by custom software that I helped build over years.

I like to build things!  Like most other software developers, I get excited about building stuff.  One of the unmentioned frustrations of many software developers is building something and then seeing it shelved.

However, it was clear from the survey of solutions that there were three choices:

  1. buy something off the shelf
  2. get better as software developers and really, really accelerate our development
  3. have the business be negatively affected by this piece of software

Now, #3 is obviously not a good solution.  #2 is a great solution, but is hard to put into practice, especially in a short time frame with a large code base (though we are trying to use some of the agile methodologies to make our software development more productive).

#1 it is.

Was this a wise choice?  Talk to me at the end of the implementation, but I am hopeful.  We did take several steps to protect ourself (after all outsourcing core business functionality can be deadly), including:

  • a long, laborious evaluation
  • engagement with multiple vendors, and
  • building a set of criteria to help us determine if this outsourcing is meeting our needs

One thing that helped me take this decision a little less personally is to redefine in my mind the value of software to the company.  It’s not the particular implementation of the software that provides the value.

Unlike a software company, my company doesn’t exist to write software (see Five Worlds for more on different types of sofware development).  Instead, software exists to serve the company.  Having something off the shelf provides the similar functionality for much cheaper.  It also allows me and other members of the software team to write software that is unique.

Having been a contractor and having worked for a startup and consultancy, I’m used to being the disruptor.  In this scenario, I was the disrupted (ht, David Skinner).  It’s a humbling place to be, even if I wasn’t disrupted out of a job.

Word to the Wise

I recently read this post about startup team success from Paul Graham.  Always fun to read Paul–I have a few sites I remember and type in periodically (haven’t used an RSS reader since Bloglines), and paulgraham.com is one of them.

The older I get, the more I see that being resourceful and having follow through are very very valuable traits.  This post just confirmed that.

The corollary to that is, if you don’t think you are going to follow through on a suggestion or a favor someone asks of you, it’s far better to say no up front than to fail to follow through.  That is going to be a tough lesson to integrate into my life, but it’s the flip side of that coin.

Building A Site With Google Sites

I recently built out a site for a local tax firm, Cahill, O’Kelly and Associates using Google Sites.  I’ve already talked a bit about using Google Sites for your web presence, but I wanted to share a bit more about my experience.

The reasons I chose Google Sites over something more flexible was pretty much based on what I determined was best for the client.

  • the client is not super technical and was wary of a website
  • I wanted the client to be able to update the site so they wouldn’t have to pay me to
  • they were not super picky about design of the site, so were willing to pick from a template for look and feel
  • site was small and functionality desired was limited (brochureware)

All of these added up to doing something that was quick, cheap, low risk, and easy.  If any of these decision points had been different, then Google Sites would have become a less attractive choice.

Good things about Google sites

  • easy to get going
  • easy to integrate with all of googles other services (analytics, webmaster tools, google forms, etc)
  • lots of templates to choose from
  • hosting is free

Things that suck about Google sites

  • the footer links are out of your control
  • some of the templates require photoshop knowledge to customize (background images)
  • no easy way to roll back changes to your site
  • some of the admin UI is clunky
  • scrolling around the look and feel customization page was difficult

Tips for developing on Google Sites

  • make sure your customer fits the profile mentioned above
  • educate your client on the limitations
  • make backup copies of your sites before you do big look and feel changes.  That way you can manually view the differences and roll back if needed
  • get to know google forms, as that is the only way to do interactive forms that I found
  • be prepared to spend some time tweaking the layout
  • be prepared to do some training on how to edit the site

All in all, Google Sites is a great solution for a certain type of client.  Consider adding it to your toolbox if you do site development.