Example: Using RxJS with HTML 5 Geolocation and DOM Events

Let's take a look at a larger sample of how we can use our RxJS-enabled Geolocation function in any web page. First, let's create some HTML, as follows:

<html>   <head>     <script type="text/javascript" src="lib/jquery-1.6.2.js"></script>     <script type="text/javascript" src="lib/rx.js"></script>     <script type="text/javascript" src="lib/rx.jQuery.js"></script>   </head>   <body>     <h2>Geolocation + RxJS sample</h2>     <form>       <select id="mapOpts">         <option class="typeopt" value="roadmap">Road Map</option>         <option class="typeopt" value="satellite">Satellite</option>         <option class="typeopt" value="terrain">Terrain</option>         <option class="typeopt" ...

Get Programming Reactive Extensions and LINQ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.