Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.addGroup('testPackages', {
- normalStyle: new ol.style.Style({
- stroke: new ol.style.Stroke({ color: '#c407d3', width: 3, lineDash: [.1, 5] }),
- fill: new ol.style.Fill({ color: 'rgba(196, 7, 211, 0.1)' })
- }),
- hoverStyle: new ol.style.Style({
- stroke: new ol.style.Stroke({ color: '#c407d3', width: 3, lineDash: [.1, 5] }),
- fill: new ol.style.Fill({ color: 'rgba(196, 7, 211, 0.4)' })
- }),
- selectedStyle: new ol.style.Style({
- stroke: new ol.style.Stroke({ color: '#c407d3', width: 3 }),
- fill: new ol.style.Fill({ color: 'rgba(196, 7, 211, 0.4)' })
- })
- });
- this.addGroup('cabinets', {
- normalStyle: new ol.style.Style({
- image: new ol.style.Icon(({
- scale: 0.25,
- anchor: [0.5, 1],
- anchorXUnits: 'fraction',
- anchorYUnits: 'fraction',
- opacity: 1,
- src: '/images/olMaps/house.png'
- }))
- }),
- hoverStyle: new ol.style.Style({
- image: new ol.style.Icon(({
- scale: 0.25,
- anchor: [0.5, 1],
- anchorXUnits: 'fraction',
- anchorYUnits: 'fraction',
- opacity: 1,
- src: '/images/olMaps/house.png'
- }))
- }),
- selectedStyle: new ol.style.Style({
- image: new ol.style.Icon(({
- scale: 0.25,
- anchor: [0.5, 1],
- anchorXUnits: 'fraction',
- anchorYUnits: 'fraction',
- opacity: 1,
- src: '/images/olMaps/house.png'
- }))
- })
- })
- drawLine(geoShape: any, assetId: string, group: IAssetGroup) { // vectorLine: ol.source.Vector, style?: ol.style.Style) {
- // Transform the geometry for a map line-string.
- const transformedGeometry = this.transformCoordinates(geoShape);
- const lineString = new ol.geom.LineString(<any>transformedGeometry);
- // Create the line-string feature.
- const feature = new ol.Feature({
- geometry: lineString,
- id: assetId,
- group: group
- });
- // Set the style on the feature?
- if (!!group.normalStyle)
- feature.setStyle(group.normalStyle);
- // Add the feature to the vector-set.
- group.vector.addFeature(feature);
- // Add to list of all features.
- this.allFeatures.push(feature);
- this.lookupFeatures[assetId] = feature;
- }
- drawMarker(geoLocation: [number, number], assetId: string, type: string, group: IAssetGroup) {
- // Transform the geometry for a map point.
- const coordinates = this.transformCoordinates(geoLocation);
- const pointGeometry = new ol.geom.Point(<any>coordinates);
- // Create the point feature.
- const feature = new ol.Feature({
- geometry: pointGeometry,
- id: assetId,
- group: group
- });
- // Set the style on the feature?
- if (!!group.normalStyle)
- feature.setStyle(group.normalStyle);
- // Add the feature to the vector-set.
- group.vector.addFeature(feature);
- // Add to list of all features.
- this.allFeatures.push(feature);
- this.lookupFeatures[assetId] = feature;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement