Leaflet Geolocation error: Only secure origins are allowed

I described some reasons to switch to HTTPS on my website. To be completely honest though, I didn’t finally get off my ass do that for any of those good reasons. I did it because I was building a map thing which requested browser geolocation and I noticed geolocation stopped working in chrome.

I’ve seen this deprecation warning a few times:

“getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.”

But somehow didn’t take it seriously. But yes. New versions of chrome won’t do geolocation unless it’s a HTTPS site. See this for yourself with this very basic geolocation test page on w3schools (which is http). [Update: Originally this was http, and so didn’t work in chrome. w3schools have since gone https]

The javascript console still only shows it as a deprecation warning not an error, but if your web application was relying on this…  it broke.

(Update for Aug 2017) Firefox v55 is going with this lock-down too. It says “Geolocation error: User denied geolocation prompt” as a popup, and in the console “A Geolocation request can only be fulfilled in a secure context.”

Any sensible application should probably be watching out for failure cases with geolocation anyway (see later examples for handling errors), but even so I find it a bit surprising that any old websites using geolocation across the web will be broken. There’s a bit more info on this google developers page

If you use LeafletJS, there’s a map.locate method which presumably uses the same method internally (navigator.geolocation.getCurrentPosition), but leaflet also detects the Chrome failure and pops up a different error message…

“Geolocation error: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV)..”

If you use chrome you can see this on my geolocate example (http) here:

http://harrywood.co.uk/maps/examples/leaflet/geolocate.view.html

…and    *Trumpet noise*   see it fixed with the newly available https URL:

https://harrywood.co.uk/maps/examples/leaflet/geolocate.view.html

HTTPs on this site

I made harrywood.co.uk run on HTTPS recently. Quite easy to do, and free using letsencrypt

https

Why encrypt harrywood.co.uk?

On the face of it there’s not much point. This is mostly just a straightforward read-only website. Not much scope for bad people to be snooping anything interesting. No passwords or credit cards or anything. General “tracking” doesn’t seem particularly problematic either. Who really cares if somebody can track the fact that you’ve been visiting these sweet innocent innocuous blog posts? Well…

Some types of commercial web tracking only tend to get creepy when they happen in bulk. The evil corporate advertising machine won’t learn much about you from knowing you read a blog post on harrywood.co.uk, but it might start to know you pretty well if it knows this and the previous thousand websites you visited. Encryption throws a spanner in the works for some types of tracking.

Government tracking by intelligence agencies, is also thwarted by encryption (more so probably). They would also like to intercept your browsing traffic to get to know you with their big evil AI. Now sometimes I think it’s fair enough for governments to do a bit of anti-terrorism targeted snooping, but the trouble is it’s too easy for politicians to make that simple-minded argument. The flipside is a subtle future threat of eroded freedoms. That’s tricky, and in general I don’t trust politicians to weigh it up properly. We can use technical measures (encryption!) to help things move in a more freedom preserving direction.

Tracking is a numbers game, done across many websites, and equally encryption as a counter-measure is more effective if we encrypt many websites. If we start to be able to browse a significant proportion of the web in HTTPS, even right down to piddly little websites like this one, then we’ll be getting somewhere. As a result it’s becoming recommendation and slowly a sort of groundswell of expectation on webmasters to do this. It’s slow to get lazy webmasters like me to do something like this, but …well now’s the time for harrywood.co.uk (Who knows? One day I may actually work on updating the content!)

Encryption helps protect against password snooping security issues. harrywood.co.uk has no user passwords, except…  my own password for logging in to write blog posts. I’ve probably used this from public wifi access points in the past. Slapped wrists for me. But now I guess I can be a little more relaxed about that. Speaking of wifi, wifi javascript injection (attacks or just crappy advertising) seems like a nasty problem. Are we safe using any wifi these days? Well we’re a lot safer from this when browsing HTTPS sites.

Free iOS games

Here’s some iOS games I’ve found enjoyable. These are all FREE.

angry-birdsObviously Angry Birds is a good place to start if you’ve not played any games on your phone. A blockbuster success for a reason. Quite addictive, and broad appeal (meaning they’ll draw you in, even if you’re not the kind of person that enjoys games). There’s also more of the same with several variations on the theme: Angry birds seasons. Angry birds star wars. Angry birds rio. etc etc.

I guess Candy Crush is similar. That one’s so mainstream my wife plays it. Personally I’ve deliberately denied myself that time-waster. In general I’m trying to avoid the super-mainstream blockbuster apps, but…

dotsDots is the stylish minimalist version of candy crush. Same idea. Swiping to match up lines and clear things tumbling down from above. But yes, less cutesy more minimalist graphics.

line-upLineup Puzzle. Make lines from different shapes, very similar to tetris, but without the blocks tumbling down from above (is this all sounding abstract enough for you)

amazing-thiefAmazing Thief. Another super-dinky little game. In fact this “Ketchapp” developer seems to specialise in insanely simple little free games. I’ve tried a lot of them, but this one was my favourite. I don’t quite know why I played this one until I managed I score of 22. Maybe because the single tap control is good for playing while crammed on a crowded tube train.

little-craneThe Little Crane That Could. Ever wanted to pull those levers to control an articulated crane? This 3D crane simulation is remarkably entertaining. I think it’s the realistic physics simulation that makes it. The free version only gives 5 missions. Even I have been tempted to pay for more.

airplaneAirplane! So speaking of physics I tried a few flight sim free apps. This one didn’t have particularly good physics, but it kept me entertained for quite a while for some reason. Maybe the choice of planes and the challenge of enabling new ones.

f18-carrier-landingF18 Carrier Landing. This one has better physics and more interesting controls. Weirdly they went to the trouble of developing this nice flight-sim engine and then made the game mission extremely limited. You just land on an aircraft carrier. That’s it. It’s like they forgot to make the rest of the game. But randomised weather conditions and start locations kept me entertained.

I can’t say I’ve done a systematic review of lots of free apps by genre. This is just some apps I’ve stumbled across and which turned out to be pretty entertaining (sometimes against my first impressions).

Playing silly little games on my phone is a guilty pleasure of mine. I’ve generally only ever installed free games, because… well, long story short, I’m a cheapskate. But they are very hit & miss. They can be a bit rubbish or not working at all for whatever reason. Increasingly they can have such unbearable advertising bombardments, in-app purchase nags, or sign-up demands, that I don’t really get as far as figuring out if the game is any good. Sorting the wheat from the chaff is a problem. Hence I thought this list might be useful for others.

I’d like to list some free and open source examples, but it seems open source isn’t a big thing for iOS developers. There’s very few working games on the appstore (as opposed to game engines / ideas) where you can also find the source code. I thought I’d installed Lumio off the appstore (quite a nice little game) but can’t find it on there any more.

I’m actually getting around to writing this finally now that I’m ditching my iPhone (and all these games) and swapping to a new android phone! I imagine I may be able to write a similar list but just for free open source games on android.

Grandma trying lemmings

I thought I’d share a memory of my Grandma who died about four years ago.

grandma-sunglasses

Although grandma was always old and lady-like as any grandma should be, she did like trying things. I sat next to her in a restaurant one time with these over-the-top thick-rimmed sunglasses. She wanted to try them.

But my favourite, most vivid memory of this was one time in my mid-teens. The grandparents were visiting for a week or so. Long enough to be bored of having them around, so I was back to my usual entertainment choices. I was hiding upstairs in my attic bedroom playing computer games. I was playing “lemmings”. Continue reading “Grandma trying lemmings”

An OpenStreetMap training course intro

A week ago I got together with Steve Chilton and Steven Feldman and gave an OpenStreetMap training course to a handful of enthusiastic young people who were about to head out to Ghana as volunteers with a charity called tzedek.

Steve Chilton & Harry Wood teaching OSM
Photo by Steven Feldman CC-BY NonCommercial

I’ve done similar things before but nothing exactly termed a “training course” actually. It was pretty similar to the UCL Masters Student mapping party Sept 2010. Back then I was asked to kick things off with an introduction, and had to stand up and make something up on the spot. This time I had some slides prepared.

Which slides? Well maybe I should’ve just used learnosm.org teaching resources for this. I took a look at them, but I decided I wanted to say a bit more in the intro sessions (perhaps wrongly actually). The learnosm.org slides are Continue reading “An OpenStreetMap training course intro”

Workshop on Using OpenStreetMap Data

 

I presented a workshop (or at least a live demo session) at the Society Of Cartographers conference with the rather vague open ended title of “Using OpenStreetMap Data”   –  “A tour of the various options for downloading and otherwise accessing OpenStreetMap data from a geo-data user’s perspective. Harry Wood will explain how to delve into the raw data structures using tools on the website and elsewhere, how to explore the wiki-style editing history, how OpenStreetMap’s unique ‘tags’ approach works, and some ways of manipulating the map data.”   At least that’s what I wanted it to be. It didn’t go entirely to plan (see apologies below)

I started by presenting some slides from my OpenTech OpenStreetMap developer ecosystem presentation which highlights the central role of raw geodata, and gradually builds up a picture culminating in this diagram (see above link for the full build-up and explanation)

Also a re-use of the slide explaining different levels of OpenStreetMap use which developers and data user organisations might consider.

Then it was on to the live demos touring around various different topics and tools. I don’t think I actually timed it well enough to get through all these things in either of the two hour-long sessions, but the following were Continue reading “Workshop on Using OpenStreetMap Data”

Some new repton3 maps

Peter McElwee emailed me saying “Thanks for releasing Repton 3, have lots of fun but the wife isn’t so pleased. Anyway have made two levels of my own, would be great to have your comments”

So you can now download his ‘names.rls’ levelset file.

<sarcasm> Repton3 is a fast moving sector of the games industry. The game was released in 1985 for the BBC micro and electron. I made my repton3 version for windows in 1998, just 14 years later. Gamers the world over set to work proving their puzzle solving prowess by conquering my two levelsets as quickly as they could, and sure enough in 2000 my mate Will succeeded, followed by two more people in 2006 (hot on his heels!) I also made a level editor, knowing that this would send gamers into a frenzy as they they start designing levels and emailing me with files to share. Sure enough in January 2011 Peter sent me this names.rls file, and so I didn’t waste a second to publish this on my website 14 months later.

but seriously </sarcasm> it is actually quite exciting for me to receive some repton3 puzzles from somebody else. Thank you Peter, and massive apologies for failing to do anything with your email for the past 14 months! I sort of forgot about it because repton3 is languishing on my under-used windows machine these days. But actually the real reason was, I wanted to play through your maps myself, and then reply saying they were too easy…  but then I got a bit stuck! I have now played them though. Good fun playing other people’s repton puzzles!

Giving up twitter for lent

I’ve decided to give up Twitter and IRC for 40 days and 40 nights. This is quite a big deal for me. It remains to be seen how well it works, but I’ve survived the first couple of days. @harry_wood has gone quiet!

Somehow twitter has become very entwined in how I operate. I use it to keep up to date with news and interact with a “professional network” and “friend” type people within various spheres: OpenStreetMap, open data particularly transport data, general IT tech & mobile/web. Reading, interacting, announcing and microblogging on these topics. And it’s great. I’m hooked on it and I’m happy with it, but…

I’m anticipating some possible positive effects of giving it up for the next 40 days and 40 nights.

Maybe I’ll blog more. Somehow twitter uses up a lot of the creative energy that previously would have gone into writing blog posts. I know I’m not the only one to more or less stop blogging as I embraced twitter. There’s a few things I really should have blogged about but lately I’ve just been using my blog for publishing presentation slides. So more to come here hopefully.

These days twitter replaces RSS for many people. It’s normal to tweet with a link to your blog every time you post. Should I allow myself this? I think not. I’m going cold-turkey on this one! Who knows, maybe somebody else might tweet a link to here. Or maybe nobody will read this 🙁   As usual, if you say “hi” in the comments it will make me happy. If you don’t, then I’ll just brood about whether or not I have a signficant number of lurkers.

The other positive effect will be eliminating the time sink that twitter represents. Although twitter is a neat way to distil things and the signal to noise ratio isn’t too bad (otherwise I wouldn’t use it) I can’t deny that it is often just a tempting distraction. One click of that juicey looking tweetdeck icon and I can marvel with a dizzying feeling as technology and society and all manner of fun seredipidous nonsense spins before my eyes, and… oh yes I was supposed to be doing some work.

I’ll be quitting IRC too (Chatrooms for those who don’t know) The mac Adium IRC client lets me auto-join all my favourite OpenStreetMap channels, and then the cute little green duck flaps its wings when someone wants to chat to me. How can I not click on a cute flapping green duck?? I won’t go completely cold turkey on this, because I have some meetings I need to attend, but over lent the duck will die.

I imagine I may move onto facebook and google+ to get my fix of realtime updates. I’ll allow myself this because I see it as another positive. I feel I should try to understand google+ better. After the failure ot orkut, buzz, and wave, it seems google are going to shove this one down our throats via their search results, so perhaps there will be no escaping how important it will be for promoting things. Meanwhile facebook is where all my non-techy friends hang out. I should stay in touch with them better. Also it’s easy to forget that facebook is much more mainstream than twitter, so promoting on facebook has more potential reach, if you can get your message right (and non-techy enough). It can well be argued that twitter is a terrible echo-chambre. A community of people all re-tweeting eachother, stroking eachother’s egos, whilst forgetting that there’s a big world out there beyond. I don’t really think that, twitter friends, but I sometimes wonder.

Well for 40 days and nights I am severing my connection to the hive. Wish me luck!

Oh and if you’re wondering how to reach me, drop me an email. Yeah one of those old things. If you limit it to 140 characters I’ll probably find that comforting in some way.

Society of Cartographers Plymouth



A couple of weeks ago I was in Plymouth for the Society of Cartographers Annual Conference. Lots of interesting talks and a fun and friendly atmosphere, particularly during the evening entertainment: pub quiz, boat trip and rum cocktails. [update: forgot to say my photos from the conference are here]

I came across a strange new breed of people who knew all about making maps using only adobe illustrator. That’s a side of “cartography” which rarely surfaces at the geo events I’ve been to before (and I’ve been to quite a few now), but this seems like a rather interesting artistic end of a map-making spectrum. I didn’t come across anyone who had tried out OpenStreetMaps options for exporting to Illustrator. This probably needs to be made easier, but I suspect Maperative might be a kick ass tool in this arena. I don’t have illustrator myself, so I’d be interested to know how well it works.

I gave a talk on a blend of topics to do with transport and open data and some of my experience of mobile geo development. I talked through some stuff I’ve been working on at placr.co.uk: The UK Travel Options iPhone app, and the more recent placr.mobi mobile website. Then I gave a few more nice bits of bus route related technology (and cartography) coming out of OpenStreetMap.

The slides and notes (approximately what I said in the talk) are included with the presentation on slideshare, or OpenOffice download, or PowerPoint download …or here it all is in good old pictures & text:


Slide 0


I’ve got four different things I want to talk about.

I want to talk about Open Data, and specifically Open Transport Data. And I want to talk about the work I’ve been doing at placr.co.uk, and finally my hobby and passion OpenStreetMap.

Lots to cover, but fortunately they’re all wonderfully interrelated, so it’s really just one big topic.

Continue reading “Society of Cartographers Plymouth”

VisionOn.TV OpenStreetMap interview

As well as giving a talk at OpenTech, I also did little interview about OpenStreetMap for VisionOn.TV:

visionontv-interview-frame.jpg

It’s on youtube.

The “Documentation” link I mentioned is wiki.openstreetmap.org. Find out all about the OpenStreetMap project there.

The video featured here is an animation of OpenStreetMap edits back in 2008 (It’s stunning. Watch it full-res for the best effect) There’s even more worldwide editing activity on OpenStreetMap these days.

The talk I gave at OpenTech earlier in the day, is described in the previous blog post (also available as a video) That was going into more depth particularly for developers interested in using OpenStreetMap

Video

Thanks to the nice folk at VisionOn.tv for organising an interview in their “pop-up studio” there. VisionOn.TV is a pretty interesting citizen journalism project. Their approach was to do almost all their editing (e.g. dropping in the OSM animation video) “live” as they recorded the interview. This probably gives them a more fun live TV feel to their “studio” activities, but it also seems like a clever approach to avoid endless faffing with editing

…which is a big problem with creating video. I spent hours and hours on this tutorial video. The results were not really worth the time it took (That tutorial is now out-of-date for several reasons too) At the time I realised that I could have achieved almost as good a video by practising a few times and then recording the whole screencast in one take, rather than doing things piece by piece and editing clips together, which just takes forever.

I’m interested in this stuff because video is the way to reach out to the masses. Make stuff which appeals to the short attention span of the youtube generation. The Video approach is a no-brainer. The process of making video is difficult. For OpenStreetMap we need better promotional videos and video tutorials. Compare videos on that list, with the “guided tour” video (well flash animation actually) which is front and centre on waze.com . It’s a slick persuasive pitch to ordinary non-technical people (Important note: Don’t be persuaded! waze.com is one of several companies who get people to contribute geo-data, and then hoard it for their own commercial benefit. You should be supporting the not-for-profit OpenStreetMap project instead!)

This interview video is not a slick pitch. I’m concentrating on trying to explain OpenStreetMap in a persuasive way, and as a result I’m furrowing my brow and looking too serious. And when I first watched it back I thought I’d really failed to get various important messages across, particularly about the open data aspects of OpenStreetMap. But I guess that’s the short video way. Dumb things down and miss out the details. I feel better about it when I see a facebook comment from my (non-techie) sister saying “good explanation, I get it now!”.