HTML and CSS Reference
In-Depth Information
Try it out—and challenge yourself!
With the exception of the Location Map button, which you'll implement in the next section,
you should be able to format the text in the visual editor to your heart's content using the
rich-text editing toolbar. A few easy enhancements you could include here would be to
provide support for more commands, to bind a keyboard event to a command (for example,
Ctrl-B or Cmd-B could be mapped to bold), and to indicate the current selection state of the
toolbar (for example, the Bold button should be depressed when the selected text is bold).
To implement the latter, you can use the Editing API method queryCommandState ,
which is covered in more detail in appendix B .
3.2.3. Mapping a user's current location with the Geolocation API
To enable your application to insert a map based on the user's position, you'll need to
use the Geolocation and Google Maps APIs. The Geolocation API provides the method
getCurrentPosition , which will enable the application to obtain the user's geo-
graphic coordinates. The Google Maps API provides a querying function to return a static
map from a set of submitted coordinates.
Search WWH ::

Custom Search