skills/my-openlayer-helper/SKILL.md
Initialize my-openlayer maps, add points/lines/polygons, configure Vue overlays, switch base layers, handle measurement tools, register custom projections, and manage runtime config. Use when the user asks about my-openlayer setup, OpenLayers map initialization, adding map markers, pulse points, static or animated flow lines, polygon drawing, map overlay components, layer switching, feature selection, measurement, custom projections, projection registration, EPSG transform errors, map clipping, or runtime default configuration.
npx skillsauth add cuteyuchen/my-openlayer my-openlayer-helperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
MyOl constructor with a container ID and options.getPoint(), getLine(), getPolygon(), getTools()).add* methods. In 3.0 real layer methods return unified LayerHandle; Overlay/Vue point methods return ControlHandle. Point APIs (addPoint, addClusterPoint, addPulsePointLayer) accept both PointData[] and standard GeoJSON (FeatureCollection, Feature, MultiPoint geometry). Use MyOl.addGeoJSON(data, options) to render mixed geometry types (point/line/polygon) in one call, with automatic grouping and per-feature styling.destroy() — 3.0 destroy() cascades to all sub-modules automatically.import { MyOl, ProjectionManager, ConfigManager } from 'my-openlayer';
// (Optional) Register custom projection before creating map
ProjectionManager.register({
code: 'EPSG:4528',
def: '+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=40500000 +y_0=0 +ellps=GRS80 +units=m +no_defs'
});
// (Optional) Override global defaults
ConfigManager.setDefaults('LINE_OPTIONS', { strokeWidth: 4 });
// 1. Initialize map (container element must exist in DOM)
const map = new MyOl('map-container', {
center: [120.155, 30.274],
zoom: 12,
token: 'YOUR_TIANDITU_TOKEN'
});
// 2. Add point markers (3.0 add* returns unified LayerHandle)
const handle = map.getPoint().addPoint(
[{ lgtd: 120.15, lttd: 30.27, name: 'Hangzhou HQ' }],
{ layerName: 'offices', img: '/icons/marker.png', textKey: 'name', scale: 0.8 }
);
// 3. Add animated pulse markers
const pulseHandle = map.getPoint().addPulsePointLayer(
[{ lgtd: 120.16, lttd: 30.28, name: 'Warning Village', lev: 0 }],
{
layerName: 'warnings',
levelKey: 'lev',
img: '/icons/village.svg',
scale: 0.8,
textKey: 'name',
textVisible: true,
pulse: { radius: [8, 28], duration: 2400 }
}
);
// 4. Clip entire map to a region
map.getTools().clipMap(geoJsonBoundary);
// 5. Cleanup on unmount (cascades to all sub-modules in 3.0)
onUnmounted(() => {
map.destroy();
});
// Auto-detect point/line/polygon, group by property
const handle = map.addGeoJSON(mixedGeoJSON, {
layerName: 'risk',
groupBy: 'level',
point: { textKey: 'name', textVisible: true },
line: { strokeColor: '#3b82f6', strokeWidth: 3 },
polygon: { fillColor: 'rgba(239,68,68,0.15)' }
});
// Per-feature styling via callback
// props = original feature properties (without lgtd/lttd)
// ctx = { datasetKey, groupKey, feature: FeatureData, index }
map.addGeoJSON(points, {
layerName: 'styled',
point: {
styleByProperties: (props, ctx) => ({
circleColor: props.risk === 'high' ? '#ef4444' : '#22c55e',
circleRadius: ctx.index === 0 ? 10 : 6
})
}
});
// Handle operations
handle.setVisible(false);
handle.setGroupVisible('high', false);
handle.removeGroup('low');
handle.remove();
new MyOl(...). In Vue, initialize inside onMounted, never in setup.[longitude, latitude] in EPSG:4326. EPSG:3857 projected values will misplace features.ProjectionManager.register({ code, def }) to register custom EPSG before creating map instances. MyOl automatically registers EPSG:4326, EPSG:4490, and EPSG:4549.MyOl.createView() initializes projections internally. If production reports No transform available between EPSG:4326 and EPSG:4490, check that the package version includes this static initialization path.projection.def contains +units=m, let proj4/OpenLayers infer the unit. Only pass projection.units when explicitly overriding the inferred unit.addPulsePointLayer over addDomPoint when rendering large warning/village pulse point lists.addHeatmap produces an invisible layer, check that the data has a numeric field matching valueKey (default 'value'). 3.0 auto-falls back to equal weight when the field is missing, but you should specify valueKey explicitly for meaningful gradients.zIndex for addMaskLayer to 12 (above Tianditu base at 9). If upgrading from 2.x and the mask was previously invisible, no code change needed.MyOl.destroy() automatically calls SelectHandler.destroy(), Line.destroyAllFlowLines(), Point.destroyAll(), and Polygon.destroyAll(). You do not need to manually clean up sub-module handles before calling destroy().updateProps to correctly pass prop values (previously they were placed in the prop declaration position). Call instance.updateProps({ label: 'new value' }) and the Vue component will re-render with the new value.MyOpenLayersError with an ErrorType tag (VALIDATION_ERROR, MAP_ERROR, LAYER_ERROR, COORDINATE_ERROR, DATA_ERROR, COMPONENT_ERROR). Catch and instanceof check to distinguish error categories. Subclasses LayerNotFoundError, InvalidGeoJSONError, ProjectionError are available for finer-grained handling.destroy() cascade.add* handles, and destroyAll.addLineByUrl, and destroyAllFlowLines.addPolygonByUrl, and destroyAll.updateProps in 3.0.setMapClip, clipMap (all-layer clipping), fitToLayers, fitByData.selectByIds, selectByProperty, and destroy.getCurrentBaseLayers.register, initialize, resolveViewProjection). Replaces MyOl.initializeProjections.setDefaults / getDefaults / resetDefaults for runtime config changes.on / off / offAll / clear.LayerNotFoundError / InvalidGeoJSONError / ProjectionError subclasses.tools
Initialize my-openlayer maps, add points/lines/polygons, configure Vue overlays, switch base layers, and handle measurement tools. Use when the user asks about my-openlayer setup, OpenLayers map initialization, adding map markers, pulse points, static or animated flow lines, polygon drawing, map overlay components, layer switching, feature selection, measurement, custom projections, projection registration, or EPSG transform errors.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------