Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addmarker(lat, long, flag) {
- iconFeature = new ol.Feature({
- geometry: new ol.geom.Point(ol.proj.transform([+long, +lat], 'EPSG:4326', 'EPSG:3857')),
- name: 'NULL'
- });
- iconStyle = new ol.style.Style({
- fill: new ol.style.Fill({
- color: '#008000'
- }),
- stroke: new ol.style.Stroke({
- color: '#008000',
- width: 3
- }),
- image: new ol.style.Circle({
- radius: 6,
- fill: new ol.style.Fill({
- color: '#008000'
- })
- })
- });
- iconFeature.setStyle(iconStyle);
- vectorSource[flag] = new ol.source.Vector({
- features: [iconFeature]
- });
- vectorLayer[flag] = new ol.layer.Vector({
- source: vectorSource[flag]
- });
- map.addLayer(vectorLayer[flag]);
- }
- function changemarker(lat, long, flag) {
- vectorSource[flag].clear();
- map.removeLayer(vectorLayer[flag]);
- addmarker(lat, long, flag);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement