Gist 890902
✓ Published0🌍 Public
Aandrewxhill
Last edited Mar 28, 2011
Created on Mar 28, 2011
This example defines a reusable canvas-based map marker component for the mol.ui framework. It creates a 120x120 pixel canvas element and layers three separate images—background, foreground, and error state—using the Canvas 2D API’s `drawImage` method. The code supports dynamic icon loading via `setIconSrc` and exposes a `getDataURL` method to export the composite marker as a PNG. The rendering approach relies on explicit canvas drawing operations rather than DOM elements, making it suitable for custom map overlays.
AI-generated description