Time for action – using DOM manipulation with OpenStreetMap map images
Reusing knowledge about OpenLayers renderers from Chapter 3, Charting the Map Class and OpenStreetMap from Chapter 4, Interacting with Raster Data Source, let's review how to manipulate the DOM and changing OpenStreetMap tiles sources on the fly.
So, let's start with the official OpenLayers example from http://openlayers.org/en/v3.0.0/examples/simple.html using Page inspector.
Open the file and at the end of the URL you get from your browser add
- Click on the Page Inspector icon (or right-click on image and click Inspect in the menu) and hover over the images. .
- Then, on one of the
imgtags, right-click on Edit attributes, as illustrated in the following screenshot: ...