HTML5 Canvas Map Clickaround Primer Tutorial

HTML5 Canvas Map Clickaround Primer Tutorial

HTML5 Canvas Map Clickaround Primer Tutorial

HTML5 brought in the incredibly useful “canvas” element, for the first time. Its existence opens up a whole new world of possibilities for web applications that are graphical by nature.

With the canvas element’s drawImage() method you can draw more than your own geometrical constructs, you can have an image, and that image could be a map, as for today’s “Ireland Clickaround” web application (with access to maps of Brazil and United States of America and the World too), where you click on the map (and thanks to mapsofworld.com for downloadable free maps here) to show a Google Map of interest via Google Chart Map Chart. Maybe you can use the map of Ireland to …

  • plan a trip
  • look up where relatives live
  • imagine you’re in O’Connell Street

This web application calls on tiny bits of mapping knowledge, namely the “orientation” of your “map”, as you are effectively digitizing to show where you want your Google Map to zoom in on.

This is one of those occasions that your (simple) software is a lot more effective using the Mercator map projection (that exaggerates the polar areas (like you might have had at school) because the simple latitude and longitude distances everywhere are the same (but relative areas definitely are not (ie. much bigger than reality near the poles))). Unfortunately, our United States of America projection is not Mercator, but you’ll still get a “ball park” Google Maps feel.

So we can have it that if the user doesn’t zoom, they need no orientation checks, but otherwise we need to determine a scale, by the user clicking on Dublin, on the map, and from that, we can work out the scaling that needs to be applied, as the top left co-ordinate is arranged to be (0,0) via the style=”position: absolute; top:0; left:0; “ part of …


<canvas id="canvaselement" width=600 height=600 style="position: absolute; top:0; left:0; " />

Please have a go of our live run or download the HTML programming source code you could call ireland.html (brazil.html, united_states.html, world.html), or do both?!

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, GUI, Land Surveying, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

27 Responses to HTML5 Canvas Map Clickaround Primer Tutorial

  1. Jed Nunery says:

    I gotta bookmark this internet site it seems very beneficial very helpful

  2. Neuropathy says:

    Basically wanna input that you may have an extremely nice website, I enjoy the style and style it definitely stands out.

  3. I concur, this web site is truly insightful and also we obtained a suggestion of this particular topic. I never believed that I might locate this site. I want to apply this in my life. Many thanks for this and also wish you will certainly develop even more like this one.

  4. employ says:

    hi!,I love your writing so so much! percentage we keep up a correspondence extra about your post on AOL? I need an expert on this space to unravel my problem. Maybe that’s you! Having a look forward to see you.

  5. Bonjour ! tiens c’est sympa comme site

  6. Van says:

    Thank you for all of your efforts on this web page. My mom really loves doing internet research and it’s really simple to grasp why. We notice all concerning the powerful way you provide powerful secrets on your web blog and as well cause participation from visitors on that concept plus my daughter is truly understanding a lot. Take pleasure in the rest of the year. You have been performing a great job.

  7. I enjoy, lead to I discovered exactly what I was taking a look for. You’ve ended my 4 day lengthy hunt! God Bless you man. Have a great day. Bye

  8. Thank you for sharing excellent informations. Your web site is very cool. I am impressed by the details that you have on this web site. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a perfect web-site.

  9. hello there and thank you for your information – I have certainly picked up anything new from right here. I did however expertise some technical points using this site, since I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I am complaining, but slow loading instances times will often affect your placement in google and can damage your quality score if ads and marketing with Adwords. Well I am adding this RSS to my email and could look out for a lot more of your respective fascinating content. Make sure you update this again very soon..

  10. Puppy says:

    Hello.This post was really interesting, especially because I was searching for thoughts on this subject last week.

  11. finance says:

    I’m completely agree with your declaration or the important things that you have actually discussed below in this website.

  12. Simply want to say your article is as amazing. The clearness in your post is just great and i could assume you’re an expert on this subject. Fine with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please carry on the enjoyable work.

  13. buy online says:

    Excellent blog right here! Additionally your site rather a lot up very fast! What web host are you the use of? Can I get your associate link for your host? I desire my website loaded up as quickly as yours lol

  14. obviously like your website however you have to take a look at the spelling on quite a few of your posts. A number of them are rife with spelling problems and I in finding it very troublesome to inform the reality however I will definitely come back again.

  15. health tips says:

    Anyways thanks for your suggestions. I value it. Please make even more write-ups connected to this

  16. At the finish of the day Γ’β‚¬ΛœLet your yes be your yes and your no be your noÒ€. Respect is some thing that is gained by means of believe in and trust is built on the integrity with the writer who releases words to be read by numerous.

  17. health tips says:

    I have recently started a blog, the info you offer on this site has helped me tremendously. Thank you for all of your time & work.

  18. unhas em gel says:

    I really thankful to uncover this web site on bing, just what I was searching for : D too bookmarked .

  19. Woah! IÒ€ℒm genuinely digging the template/theme of this website. ItÒ€ℒs simple, yet effective. A great deal of times it is challenging to get that Ò€œperfect balanceÒ€ between user friendliness and appearance. I ought to say that youÒ€ℒve done a great job with this. Additionally, the blog loads incredibly fast for me on Internet explorer. Outstanding Weblog!

  20. perfected says:

    Is not it great after you obtain a superb post? I enjoy you expressing your perspective.. Isn’t it amazing if you uncover a superb publish? of course, investigation is having to pay off.

  21. Remodeler says:

    I have to express thanks to the writer just for bailing me out of such a condition. Right after looking through the world-wide-web and coming across opinions which are not powerful, I thought my life was done. Existing minus the solutions to the issues you have fixed by means of your entire review is a serious case, as well as those which may have adversely damaged my career if I hadn’t discovered your web site. Your primary know-how and kindness in controlling everything was very useful. I don’t know what I would have done if I had not discovered such a step like this. I can also at this point look ahead to my future. Thanks very much for this professional and amazing help. I won’t hesitate to endorse the website to anybody who should receive care about this topic.

  22. saved says:

    Seriously practical viewpoint, many thanks for expression.. My personal web surfing seem complete.. thanks. sure, analysis is having to pay off. Recognize the value of the post you made available..

  23. I keep listening to the reports talk about getting free online grant applications so I have been looking around for the finest site to get one. Could you advise me please, where could i acquire some?

  24. Thanks for sharing superb informations. Your site is so cool. I am impressed by the details that you have on this website. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my pal, ROCK! I found just the info I already searched everywhere and simply couldn’t come across. What a great web site.

  25. change says:

    My internet browsings seem complete.. thanks. Excellent opinions you have here.. My browsing efforts seem total.. thanks. I appreciate you posting your viewpoint..

  26. As I website possessor I believe the content matter here is rattling great , appreciate it for your efforts. You should keep it up forever! Best of luck.

  27. My brother recommended I might like this blog. He was entirely right. This post actually made my day. You cann’t imagine simply how much time I had spent for this information! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>