Maps Post-Google

I spoke at the Web Directions What Do You Know night in Brisbane tonight. Here's a slightly more in-depth version of what I talked about, with links to all the good stuff. You can also view my slides though they're quite large.

Recently the Google Maps Mania blog wrote a post entitled “The slow death of the Google Maps API”, not so much lamenting the demise of Google Maps as much as embracing the change that’s occurred in this space and it got me thinking.

Google Maps used to be the only real solution to showing maps online, and I’m sure you’ve plopped down the Google Maps embed code on a contact page in your day. But lately there’s been a lot more choices cropping up in both software and services so I’m going to quickly go through some of the cool stuff you can do with maps.

Mapbox: probably better than Google?

Firstly I’ll mention that in my opinion the main competitor to the Google Maps API right now is Mapbox. Mapbox has a bunch of services and APIs for both apps and the web, and you should check them out if you haven’t already (their blog is well worth a read too).

They have a sweet web interface that lets you completely customise your map styles and content, and offer a bunch of goodies for creating and managing maps including TileMill which is the ultimate map mashup customisation whatsit.

If you’re looking to plop a map onto a contact page these guys can absolutely get you there, but if you’re looking to do a full-on data visualisation they’ve got you covered too.

Leaflet

Leaflet Maps

Mapbox are throwing a lot of support behind open source tools like Mapnik, Node and especially Leaflet.js which is the BSD licensed mapping library that most of their service runs on.

Leaflet is especially nice to use as both a user and a developer because it’s it’s super-fast and works well even down to IE7. It's completely styleable with CSS has excellent touch support for mobile devices which makes it really awesome if you need a responsive maps solution.

In terms of data visualisation, it uses SVG by default (with a VML fallback) or you can draw onto HTML5 canvas if you don’t need IE8. There's also a large number of modules you can use, both official and otherwise.

Heatwave Tracker

I’ll briefly mention the ABC News heatwave tracker which I did late last year, showing an animated map of temperatures for the past week.

This one was originally going to use Google Maps but had some performance issues on mobile that prompted the move to Leaflet.

The ABC heatwave tracker was ported to Leaflet in a matter of an hour or so.

This visualisation ended up using the basic Leaflet API to draw circles for each weather station and animating them using requestAnimationFrame. Under the hood Leaflet created a SVG circle for each of these points which turned out to be hardware accelerated to varying degrees across browsers, so it was super fast with around six-hundred data points updating at sixty frames per second.

There was no particularly tricky code involved in this, it’s all just using Leaflet’s standard APIs without any optimisations on the map side of things. The Leaflet port from Google Maps took about an hour which gives you some indication as to the effort involved.

100 Years of Air Travel

The Guardian has a much more impressive interactive with their 100 Years of Aviation feature.

This feature used a combo of Leaflet with a bunch of custom code to create a collage of maps, images, and audio showing the history of air travel. The most interesting feature is the html5 canvas-based visualisation showing all the planes in the sky over the last twenty-four hours which you can zoom, pan, and explore like a traditional map.

It's kinda mesmerising.

This one was commissioned by The Guardian and built by Kiln who I have somewhat of a map geek crush on right now. They used TileMill for the background layer (I had a suspicion!).

What about D3?

But Leaflet isn’t the only client-side library that’s doing interesting things in mapping. While Leaflet is positioned as a more traditional Google Maps replacement, D3 takes a more data-driven approach to visualising geodata.

For those not aware, D3 stands for “data driven documents” and you might remember Colin Gourlay talking about using D3 for responsive charts in the last Last What Do You Know in September.

Well D3 also has geodata functionality that can do wonderful things with more of a focus on your raw data rather than a traditional map.

This demo is from the D3 geo.projection plugin shows a few of the different types of map projection you can use in your projects, and you can see the way the map is animating between different projections that the library has a lot of power over a traditional flat map.

Earth

While this isn’t something you’d usually use in itself, it does lend to some interesting ways of visualising data, such as in the Earth global weather visualisation by @cambecc.

Earth is one of my favourite Javascript visualisations ever.

This is a really compelling mashup of wind, air pressure and temperature projected on a 2D globe then animated to show about as close as you can get to real time world-wide weather conditions.

This demo uses D3 and Backbone.js to display data which has been pre-processed from a number of different sources. It’s using the orthographic projection of D3 which presents a sweet 2d globe effect which you can spin and zoom to explore the nuances of the planet.

Because this is using the HTML5 canvas as a 2d drawing platform, all the individual data points you see moving on the screen have to be calculated each time you adjust your viewpoint. This is all done in D3 rather than on a GPU for instance, which might not be something you'd do in a super-high performance situation, but it's a really good demo of what D3 is capable of.

Google is still good…

Google Maps is still great, but they've really been focusing more on the consumer with their offerings of late.

The Google Maps WebGL globe is amazing.

The new version of Google Maps is a fantastic use of WebGL and is really a showcase use for the technology, but you can't develop against it for use in your own apps. In terms of the Maps APIs they've stagnated over the years and as a result we're seeing more innovation from other players rather than Google themselves.

So next time you're looking at doing anything to do with maps, check out some of the alternatives. You might find yourself getting more done, doing cooler things and generally looking better among your peers.

What does everyone else know?

If you weren't at Web Directions What Do You Know, here are some the other talks from the night.

Sarah Bock
Narcissism and the web
Andy Fitzsimon
Generative design is awesome (My personal favourite, I want to play with netengine.io)
Luke Brooker
Craft as in Beer
Jilly Magee
Data is the real King (and yep, content is data)

South Brisbane Fibre

Just a quick rant because I’ve been trying since October to get myself set up with fibre Internet in South Brisbane.

A little background for those of us who don’t know: South Brisbane fibre is wholly owned by Telstra, and isn’t part of the NBN. The plans are different, a lot of ISPs don’t seem to bother competing here and everything has to go through Telstra’s wholesale division.

The unit I moved into has never had a landline connected so I got hit with a ~$300 connection fee straight up. Initially Telstra thought there was a connection at this address and disconnected my landlady next door, taking out her phone and Internet for the better part of a week which was a massive pain. After that it took about a month for them to get around to installing the network stuff in my unit and another month for me to convince them it wasn’t working and come out to actually plug the fibre in at the comms room.

It literally took four hours for the poor tech to unravel the network here and get it connected. In the process I think he unplugged the line into another unit where the tenants were trying to get their own Internet connected, so they’ll probably be hit with the $300 connection fee as well.

The tech was a funny guy. Reasonable enough, although he asked me to fix his computer while he was working which was a bit awkward. When he finally got the line connected he confirmed with me that it was 30 mbit, at which point I mentioned I was trying to get 100 mbit and that something must be wrong. Before telling me that 30 mbit should be more than enough for my needs he mentioned that Telstra Wholesale only goes up to 30/1 mbit and that I’d have to sign up for a Telstra plan if I wanted to go higher.

I was pretty mad at this point, but hey, I had Internet for the moment.

Since then I’ve spent another month chasing iiNet trying to get the bottom of the 100 mbit situation. iiNet themselves have never heard of the 30 mbit limit, they’ve verified on their end that I should be getting 100 mbit, and have been super reluctant to chase it up for me. I’ve complained by phone, email, Twitter, all the while being told that someone would chase it up for me and give me a call back, or email me, or follow it up internally somehow.

I just called up now and they have no record of any of the email or phone correspondence I’ve had, the guy has reiterated that “it should be fine, have you tried power cycling your modem?” and asked me to plug my PC directly into the wall. (I’ve already done this when I initially reported the problem, I even had to borrow a laptop with Ethernet from a friend to do so.)

Meanwhile my practical speeds with two separate modems are fluctuating between the full 30 mbit and 0.5 mbit/second depending on the stars. I actually had a 700 millisecond ping to Speedtest.net this morning.

To Be Continued…

That time a truck crushed my laptop and I replaced it with the XPS 13

Waiting at the lights, my bag popped off the back of my bike somehow. I noticed straight away because the weight was different, but by the time I’d stopped and turned around, the ute behind me had driven over it with not one, but both sets of wheels.

A laptop all bent out of shape, still turns on but the screen is shattered. A tablet next to it, equally crushed.

The guy looked at me briefly, then drove off. I didn’t even think to note his license plate, I was too busy freaking out on the traffic island. My laptop is seriously my most important possession and it was immediately obvious it’s been completely written off.

I checked out my insurance, but it’s only for medical and third party which means I’ve got nothin’. I can shift some money around, but it’s certainly changed my short-term plans.

So I set out on a search for a new computer. I wasn’t going to buy another Samsung Series 9 because the quality of the screen was absolutely rubbish and having used it for a month or so I couldn’t justify the price again. So I went searching, and found the Dell XPS 13.


The Dell XPS 13 is a laptop.

Not the Developer Edition

I was originally looking at the Ubuntu Developer Edition which isn’t available in Australia. The Developer Edition comes with Ubuntu pre-installed, and a bunch of compatibility patches and developer tools already loaded on.

It’s a pretty attractive deal, because Dell have been contributing their modifications back to the Linux kernel to make sure this machine is the Linux latop amongst the Windows-crippled alternatives out there.

The XPS 13 is the same machine, just with Windows pre-installed instead. All the same bits and pieces under the hood (and a few extra stickers), but you can wipe Windows and install your choice of Linux distro over the top with no problems at all.


The Specs

There are a few models of this machine available, and I can’t find mine on the Dell site any more, so your mileage may vary.

Size
13.3″
CPU
Intel i5/i7 available
RAM
8GB Dual channel DDR3 1600Mhz
Storage
128 GB SSD (Mine has 256 GB, but this no longer seems to be an option.)
Graphics
Intel® HD Graphics 4000
Display
Full 1080p (IPS?) display
Networking
Intel Centrino Advanced-N 6235 and Bluetooth 4.0
Battery
47 WHr 6-Cell Battery
Chassis
13″, machined aluminium & carbon fibre composite shell, silicone palm rest

Initial Thoughts

My initial thoughts on this laptop were really positive. This laptop feels expensive.

Aluminium & carbon fibre shell

The device has a full 13.3″ screen, but the size of the laptop is tiny owing to the really small bezel around it. The chassis is an attractive complement of machined aluminium on the lid, carbon fibre on the base, and a silicone finish on the palmrests which is surprisingly nice to use.

There’s a metallic cover on the bottom of the laptop which opens to reveal the Windows and Intel stickers as well as FCC information and other important bits.

There are two USB3 ports, one on the left and one on the right. There’s also a Mini DisplayPort and a headphone jack. There are no other ports on the laptop. If you want to use something like cabled Ethernet you’re going to have to pick up a USB adaptor online ($10 ought to do it on eBay), or if you need more devices you’ll have to look into a USB3 hub.

I’ve noticed the lid can be a little tricky to open as the weight isn’t quite balanced with the opening mechanism but on the flip side, the lid is fixed in place wherever you put it. There’s no wobble or anything because of the heavily weighted hinge.


Installing Linux on the XPS 13

There’s a few ways you can install Linux, by USB flash drive or via an external DVD drive, it’s pretty straightforward.

The Dell XPS 13 running Ubuntu

While the device comes with Microsoft’s “Secure Boot” enabled, you have the option of going into the menus and turning it off. In addition, a number of Linux distros come with Microsoft signed keys that will run with Secure Boot enabled anyway.

Another nice touch is the ability to fall back to BIOS emulation mode, which lets you boot older OSes of if you run into shoddy UEFI support in your distro of choice.

You can get into the UEFI/BIOS interface by pressing F2 on boot. (Keep pressing it until it tells you it’s got it.)

Other than Secure Boot, this is a really straightforward machine to install on. You’ll have no problems.


The Keyboard

The keyboard is really quite nice. It’s backlit, and the chiclet style keys have a fair bit of give to them.

It’s quite nice to type with, much nicer than the Samsung Series 9 for instance, although they’re a bit softer than the generally quite firm MacBook Pro.

I’ve also been told the keyboard is an unusual layout (although I haven’t noticed), but either way you’ll likely get used to it in no time.


The Screen

The screen is the total show stealer. The original XPS 13 had a measly 768p screen, whereas this one has the full 1080p and it’s gorgeous.

I’ve gone through a few screens lately, and this is easily the best one I’ve ever used. It’s easily better than my 2010 era MacBook Pro, and wipes the floor with the rubbish used in most Windows laptops on the market these days, including the Series 9.

The screen is perfectly clear, offers no motion artefacts or screen-door effect at all (unlike it’s shonky bigger brother).

I suspect it’s an IPS screen although I haven’t been able to verify this information anywhere other than one or two news and blog sites. It has perfect colour reproduction, with no vertical colour distortion whatsoever and perfect viewing angles from all directions.

In terms of brightness it’s a 350 nit panel, which is pretty damn good. You can find other brighter laptops on the market, but this one’s perfectly good for indoor and outdoor use. It’s a glossy screen as opposed to a matte, which means it can be impossibly glarey in the wrong environments but I’ve never found myself unable to use the laptop due to lighting conditions.

Whether you’re a designer or developer, you should absolutely consider this laptop for the screen alone.


Trackpad

The trackpad is really nice. It has a smooth finish and tracks well with one or two fingers. It’s gesture capable, although I haven’t used any of these features.

Dell and Canonical have apparently taken the existing Cypress trackpad driver and extended it to support the Developer edition perfectly. These changes have been merged upstream into the proper Linux kernel and should be available on most new distributions.

I’m using the drivers that Fedora 18 picked up, and I’m not sure whether they’re the right ones or not. I’ve noticed very occasionally that the trackpad can get a little jumpy and I’ll need to suspend/resume to reset it. I’m interested in whether people have this issue in newer kernels than version 3.9.4-200.


Noise

This machine actually has a little more noise than I’m used to. While it’s no rocketship like my previous MacBook, it can get somewhat loud under load.

I’ve also noticed that the fan makes funny noises even when not under load. It’s barely noticeable, but if you shove your ear up to the bottom of the laptop you can hear it ticking and scraping. It’s a little bit of a concern, I’m not sure if I need to open it up and clean it or if that would make it worse.


External Monitors/VGA Out

This laptop uses Mini DisplayPort, like older MacBooks, which is pretty well supported.

The laptop itself doesn’t come with any cables, but you can grab a Mini DisplayPort cable to output to DisplayPort, DVI, HDMI or VGA.

I’ve driven my Dell U2711 27″ screen at 2560×1440 over DisplayPort with no problems. I understand there may be difficulties converting from DisplayPort to dual-link DVI etc for very large resolutions, so it pays to use DisplayPort→DisplayPort whenever you can.

I’ve also had problems connecting the Mini DisplayPort to a VGA projector using an Apple dongle. Turns out the Apple dongles are a bit special and won’t work with this particular laptop, so if you’re going to be presenting anywhere you’ll need to bring your own non-Apple adaptor.


Other features

The battery is a 47 WHr 6-Cell Battery but I can’t tell you much more than that. It’s not as good as the Samsung Series 9 for instance, but I rarely find it fails me when I’m out and about through the day. You should check out some other reviews for information on the battery life.

Graphics are standard Intel HD Graphics 4000, which are pretty standard across the board. The benefit of Intel graphics is that everything in Linux is supported so much nicer than with nVidia or ATI. If you’re looking for gaming, it’s not the worst you could do, but you should check around to see how the HD 4000 graphics fare on various games.

Sound is quite good. It’s much better than the Series 9 or 2010 MacBook Pro for instance. I’m not sure where it comes from, but it seems beefier than your average laptop sound. I haven’t put it through any vigorous tests (because it’s laptop sound after all) but I quite like it.

Output from the headphone jack is generally good too, free of pops and hisses, and I haven’t heard any processor squeal come through my earbuds which can be a problem on cheaper systems.


Conclusions

The Dell XPS 13 (Non-Developer Edition) is an awesome laptop and if you’re a Linux user looking for a quality device you should absolutely get this one.

While there’s a lot of different materials gone into the build, the quality is stellar. It’s a good weight, feels tough, and I consider it an extremely attractive design.

A person uses a the Dell XPS 13 at a display stand

All the useless loose ends have been removed (CD Drive, Ethernet, serial) leaving only the very basics. If you need more you can extend it with USB adaptors. It’s the ultimate minimal experience.

The speed is great, the compatibility is stellar and the display is the killer feature that beats out all the other devices on the market (with the exception, of course, of the retina Macs which aren’t much use in Linux anyway).

Everyone who sees the laptop loves it, and I recommend it for everybody. If you’re not convinced, leave a question in the comments and I’ll see what I can do to answer it. Otherwise, you’re going to love this laptop and should check it out now.

Oh my mobile!

Trying to wrap my head around mobile tech and the various protocols involved. After some quick research, this is what I’ve learned:

GSM

GSM is a 2G network spec that does calls and text, but doesn't (nicely?) support data transfer. You can add data capabilities to a GSM network with GPRS or EDGE.

UMTS

UMTS is an incompatible evolution of GSM which supports calls, text, and data. The initial release (R99/Release 1999) supports data transfer speeds of up to 384 kbit/s.

HSPA can be added to a UMTS network to acheive much faster, and eventually 4G download speeds.

CDMA

Meanwhile, CDMA networks are still popular in North America and have evolved to 3G speeds with progressive upgrades (CDMA One, CDMA 2000, and now . For the most part CDMA phones don't require SIM cards and are not compatible with 3G networks. I don't know how these phones are registered onto the network.

UMTS actually uses the underlying concepts of CDMA to operate, but when referring to simply "CDMA" people are generally talking about the trade name rather than the technique.

LTE and 4G

LTE is a data-only network based on, but incompatible with UMTS which provides 4G speeds of nearly 300 mbit/s down. As it's a packet network, traditional voice calls can't be placed (without carriers re-engineering their network) so phones either use VoIP or fall back to the next available network to talk. LTE is slated to be the first global mobile network, as even CDMA carriers are reportedly implementing it.

I think that just about covers it. Have I got this all right? Do leave a comment.

Isometric Tile Transforms

It might require a bit of initial thinking, but I'm sure it would be worth it.

I’m debating with myself whether to make my game engine pseudo-3D, using transforms and masks and whatnot to generate and texture isometric tiles.

On one hand there’s something to be said for tile-based systems to have every graphic meticulously crafted by a master designer, but on the other hand, I’m not that designer. It’d be so much easier to slap a grass texture down and transform it to match a programmatic grid. Maybe adjust the brightness to simulate lighting, then cache that sucker to achieve decent performance and move on to the next tile.

I think it’s feasible. It would allow for much easier creation of game elements such as hills and height, walls, roads, and so many more cool things. It’s also a total departure from my original idea of a traditional isometric game engine, but once it’s implemented it would make things way easier for both myself and anyone who wanted to create a map in the future because one high resolution texture could be used for countless tile combinations.

I think I’m going to give it a try, because if nothing else it’s a damn cool idea.

SVG and Canvas Transformation Matricies

Both SVG and HTML5 Canvas have basic transformations such as rotation and scaling, but they also have a more advanced “transformation matrix” mode which lets you do more complex transformations. I’m not pretending to understand it properly.

A transformation matrix has six parameters, named A—F. A lot of the documentation I found on them wasn’t particularly useful, so here’s my take on how each value works:

NameDescriptionDefault ValueExplanation
awidth11 equals 100%. A value of -1 would mirror image the object on the left hand side. .5 would halve the width, and 2 would double it, etc.
bY axis shear0A positive value shears the object downward on the righthand edge.
cX axis shear0A positive value shears the object rightward on the bottom edge.
dheight1Similar in operation to a, above.
ex offset0Offset the object on the x axis.
fy offset0Offset the object on the y axis.

So for instance, if you wanted to create an isometric tile from an image, you could use the following transform:

matrix(1,-.5,1,.5,0,0)

This would keep the same width, shear both axis by 50% effectively rotating the image 45°, and halve the height giving us our iconic half-height isometric tile.

Some other transformations relevant to isometric game tiles might might include:

OperationOutput
matrix(1,0,0,1,0,0)No change.
matrix(1,-.5,1,.5,0,0)Square sheared into half-height isometric tile.
matrix(1,-1,1,.5,0,0)Sheared into a leftwards isometric incline.
matrix(1,1,-1,.5,0,0)Sheared into a rightwards isometric incline.
matrix(1,0,1,.5,0,0)Sheared into a leftwards isometric decline.
matrix(1,0,-1,.5,0,0)Sheared into a rightwards isometric decline.

You’ll notice that the output tiles are significantly larger than would be generated with a straight out rotate and scale. You may need to add an additional scale operation to adjust the size of these tiles to fit your game board.

Putting it Together

Once you put these tiles together, you start to get an idea of how we can use canvas (or SVG) matricies to create isometric tiles for your game.

Using transforms to create game images makes tiles click into place like lego.

If you wanted to play around with transforms with a visual tool, you could check out Inkscape, the best vector editor in the world. The matrix transformation sidebar is found by clicking the menus Object , Transform, then clicking the “Matrix” tab.

Playing with SVG

Spent the day plying with SVG. I've always used Inkscape for as long as I can remember, but it's taken me this long to actually dive in and start using the underlying markup for anything more than designing stuff.

I wrote a library to take an input string in a particular format and output a fully blown diagram to scale, based on the measurements and configurations from the input. The idea is that not just myself but also the lay person can rapidly prototype a bunch of diagrams (perhaps dynamically) for the new web site, and later reuse the library for internal projects.

I'm really rather impressed with myself. Aside producing a really cool tool, I've learned a fair bit about SVG itself and how it works. It's a pretty neat language, and features a lot of traits from XML, and CSS. I can see why it was poised (and I suppose still is, although it really fizzled thanks to Internet Explorer) as a web language. I really quite enjoy XML as a markup language, so it's quite fun to use it for drawing lines, filling rectangles with predefined gradients and translating things across the page.

I'm pretty proud of my work today, and I'm quite pleased to add another entry to my wide repertoire of half known things.