MapViewer

Header Image
Project:
MapViewer : Public <<ES6 Class>> Class
Created: 2023-01-20 1:08:50 PM
Modified: 2023-02-06 12:19:25 PM
Project:
Advanced:
The MapViewer class implements the #lt;mapml-viewer#gt; autonomous custom element.  <br/><br/><br/>
  • Attributes
  • Associations From
  • Files
  • Advanced
  • Other Links
Attribute Scope Type
controls Public boolean
 
controlslist Public DOMToken
 
extent Private Object
 
lat Public float
 
lon Public float
 
projection Public TCRS
 
zoom Public int
 
Element Source Role Target Role
«L.Handler» M.FeatureIndex
Class  
Name:  
 
Name:  
 
Details:
 
M.Options
Class  
Name:  
 
Name:  
 
Details:
 
L.Control.Zoom
Class  
Name:  
 
Name:  
 
Details:
 
«L.Handler» M.QueryHandler
Class  
Name:  
 
Name:  
 
Details:
 
«L.Layer» M.Crosshair
Class  
Name:  
 
Name:  
 
Details:
 
«L.Handler» M.AnnounceMovement
Class  
Name:  
 
Name:  
 
Details:
 
«L.Layer» M.FeatureIndexOverlay
Class  
Name:  
 
Name:  
 
Details:
 
«L.Control» M.FullscreenButton
Class  
Name:  
 
Name:  
 
Details:
 
«ES6 Class» MapLayer
Class  
Name:  
 
Name:  
 
Details:
 
«L.Handler» L.Keyboard
Class  
Name:  
 
Name:  
 
Details:
 
«L.Control» M.LayerControl
Class  
Name:  
 
Name:  
 
Details:
 
«L.Handler» M.ContextMenu
Class  
Name:  
 
Name:  
 
Details:
 
«L.Layer» M.DebugOverlay
Class  
Name:  
 
Name:  
 
Details:
 
«L.Control» M.ReloadButton
Class  
Name:  
 
Name:  
 
Details:
 
File Type
./leaflet.js Local File
Details:
./leaflet.js is a minified script file created by the Grunt build process; it is a composition of the node_modules dependencies leaflet/dist/leaflet-src.js, proj4leaflet/src/proj4leaflet.js and proj4/dist/proj4-src.js.  Each of these input files is modified by the build process to be importable and usable.

The MapViewer module imports all exposed symbols of the composed ./leaflet.js file, and the composed ./mapml.js file.

The MapViewer module depends on, but doesn't strictly "import" the CSS files from Leaflet and MapML.  See file mapml.css for details.

File Size:
Time Stamp:
./mapml.css Local File
Details:
The ./mapml.css file contains the Leaflet CSS rules and the MapML rules combined into a single minified file.  The composition of these two files is not done at build time but is maintained on a permanent basis, a possibly bad choice, since we will have to reconcile upstream changes as they happen, if indeed possible.

While .js files are imported into the parent mapml-viewer.js module file, the CSS files must be loaded into the custom element shadow root.  This is accomplished by the actual constructor code of the module via the idiomatic [1] import.meta statement:

    let tmpl = document.createElement('template');
    tmpl.innerHTML = `<link rel="stylesheet" href="${new URL("mapml.css", import.meta.url).href}">`;
...
    shadowRoot.appendChild(tmpl.content.cloneNode(true));

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta

File Size:
Time Stamp:
./mapml.js Local File
Details:
./mapml.js is a minified script file that is created by the Grunt "rollup" plugin during the build process.  The rollup plugin processes the src/mapml subdirectory and composes a temporary mapml.js file from the set of files identified by src/mapml/index.js.  This temporary mapml.js file is then minified by the "uglify" plugin.  The structure of the mapml.js file enables its import via the import "./mapml.js"; statement.

File Size:
Time Stamp:
src/layer.js Local File
Details:
The <mapml-viewer>'s MapViewer module imports the MapLayer symbol from the src/layer.js ES module.  The MapViewer module, having defined the MapViewer symbol, and having imported the MapLayer symbol from src/layer.js, registers these classes as implementing custom elements with the browser, via the customElements.define interface method:

window.customElements.define('mapml-viewer', MapViewer);
window.customElements.define('layer-', MapLayer);

File Size:
Time Stamp:
src/mapml-viewer.js Local File
Details:

File Size:
Time Stamp:
Property Value
isFinalSpecialization: 0
Object Type Connection Direction Notes
«L.Handler» M.FeatureIndex Class Strong From  
«Realization» Class Generalization From  
M.Options Class Strong From  
«L.Handler» M.QueryHandler Class Strong From  
Map Viewer Component Generalization To  
«ES6 Class» MapLayer Class Strong From  
«L.Handler» L.Keyboard Class Strong From  
«L.Handler» M.ContextMenu Class Strong From