Skip to content

Commit

Permalink
update: demo
Browse files Browse the repository at this point in the history
  • Loading branch information
alfianchii committed Jun 28, 2024
1 parent 087b680 commit dc21d5b
Show file tree
Hide file tree
Showing 67 changed files with 1,224 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo/account-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/account-security.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/application-chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/application-checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/application-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/application-gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
76 changes: 76 additions & 0 deletions demo/assets/static/js/pages/ui-map-openlayers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// init map
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.fromLonLat([110.3803253, -7.7945047]),
zoom: 12
})
});

// add vector layer
var vectorLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: [
new ol.Feature({
geometry: new ol.geom.Point(ol.proj.fromLonLat([110.3647631, -7.8013849])),
name: 'Yogyakarta, Indonesia'
})
]
})
});

// set style for vector layer
vectorLayer.setStyle(new ol.style.Style({
image: new ol.style.Icon({
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
src: 'https://openlayers.org/en/latest/examples/data/icon.png'
})
}));

map.addLayer(vectorLayer);

// popup
const element = document.getElementById('popup');

const popup = new ol.Overlay({
element: element,
positioning: 'bottom-center',
stopEvent: false,
});
map.addOverlay(popup);

let popover;
function disposePopover() {
if (popover) {
popover.dispose();
popover = undefined;
}
}

// display popup on click
map.on('click', function (evt) {
const feature = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
return feature;
});
disposePopover();
if (!feature) {
return;
}
popup.setPosition(evt.coordinate);
popover = new bootstrap.Popover(element, {
placement: 'top',
html: true,
content: feature.get('name'),
});
popover.show();
});

// scale line
map.addControl(new ol.control.ScaleLine());
5 changes: 5 additions & 0 deletions demo/component-accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-badge.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-breadcrumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-list-group.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-navs.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-placeholder.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-progress.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-spinner.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-toasts.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/component-tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/extra-component-avatar.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
5 changes: 5 additions & 0 deletions demo/extra-component-comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@

</li>

<li class="submenu-item ">
<a href="ui-map-openlayers.html" class="submenu-link">OpenLayers Map</a>

</li>

</ul>


Expand Down
Loading

0 comments on commit dc21d5b

Please sign in to comment.