FOR RENT: 1st Floor Shop Lot Taman Seri Duyong Ayer Molek Melaka DETAILS: ======== * Shop lot * 1,200 sqft * 1 Toilet FEATURES: ======== * Basic unit with partition ================ RENTAL RATE: RM 900/month DEPOSIT: 2
FOR RENT: 1st Floor Shop Lot Taman Seri Duyong Ayer Molek Melaka
`;
popupContent.appendChild(placeItem);
// Create a divider after each item except the last one
if (index < places.length - 1) {
const divider = document.createElement('div');
divider.classList.add('place-item-divider');
popupContent.appendChild(divider);
}
// Create marker on the map
const marker = new google.maps.Marker({
map: map,
position: place.geometry.location,
title: place.name,
icon: getCategoryIcon(category)
});
// Store the marker for later use
markers.push(marker);
// Marker click event
google.maps.event.addListener(marker, 'click', function() {
// Recenter map on the clicked marker
map.panTo(place.geometry.location); // Recenter map to the clicked place
map.setZoom(15); // Optional: Zoom in when a place is clicked
// Open the InfoWindow for the clicked marker
infowindow.setContent('' + place.name + ' ' + place.vicinity);
infowindow.open(map, this);
});
// Make place item clickable to recenter the map
placeItem.addEventListener('click', () => {
map.panTo(place.geometry.location); // Recenter map to the clicked place
map.setZoom(15); // Optional: Zoom in when a place is clicked
infowindow.setContent('' + place.name + ' ' + place.vicinity);
infowindow.open(map, marker);
});
// Calculate and display walking distance
calculateWalkingDistance(mainLocation, place.geometry.location, (result) => {
if (result) {
placeItem.querySelector('.walking-distance').innerHTML = `
${result.duration}
${result.distance}
`;
} else {
placeItem.querySelector('.walking-distance').innerHTML = `
Walking distance: Not available
`;
}
});
});
// Hide loading indicator when data is loaded
document.getElementById('loading-indicator').style.display = 'none';
}
// Show side panel
sidePanel.classList.add('open');
// Adjust the map to center it to the right of the panel
map.panBy(-130, 0); // Shift map by 150 pixels to the left (adjust based on panel width)
}
// Function to handle active button state
function setActiveButton(button) {
// Remove the 'active' class from all buttons
const buttons = document.querySelectorAll('.btn-cat');
buttons.forEach(btn => btn.classList.remove('active'));
// Add the 'active' class to the clicked button
button.classList.add('active');
}
// Event listeners for category buttons
document.getElementById('category-train').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('train_station');
});
document.getElementById('category-schools').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('school');
});
document.getElementById('category-shopping').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('shopping_mall');
});
document.getElementById('category-healthcare').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('hospital');
});
document.getElementById('category-food-drinks').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('restaurant');
});
document.getElementById('category-parks').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('park');
});
document.getElementById('category-places-of-worship').addEventListener('click', function() {
setActiveButton(this);
searchPlaces('church');
});
// Automatically trigger the first button (Schools) on page load
document.getElementById('category-schools').click();
// Recenter the map when the recenter button is clicked
document.getElementById('recenter-btn').addEventListener('click', () => {
map.panTo(mainLocation); // Recenter map to main location
map.setZoom(13); // Optional: Set zoom level when recentering
});
// Toggle button for the side panel
const togglePanelBtn = document.getElementById('toggle-panel-btn');
const sidePanel = document.getElementById('side-panel');
document.getElementById('toggle-panel-btn').addEventListener('click', () => {
const sidePanel = document.getElementById('side-panel');
const toggleIcon = document.getElementById('toggle-icon'); // Select the icon
if (sidePanel.classList.contains('open')) {
sidePanel.classList.remove('open'); // Close panel
toggleIcon.src = "https://cdn.pgimgs.com/hive-ui-core/static/v1.3/icons/svgs/chevron-right-f.svg"; // Icon for closed state
// Recenter the map to its default center
map.panTo(mainLocation);
} else {
sidePanel.classList.add('open'); // Open panel
toggleIcon.src = "https://cdn.pgimgs.com/hive-ui-core/static/v1.3/icons/svgs/chevron-left-f.svg"; // Icon for open state
// Adjust the map to center it to the right of the panel
map.panBy(-130, 0); // Shift map by 150 pixels to the left (adjust based on panel width)
}
});
-->
Explore began as the vision of an ambitious, revolutionary-minded pioneer of the real estate market from one of the top-notch countries in the world.
Subscribe to our newsletter
By submitting your email, you acknowledge and agree that Explore may send you marketing communications and use your information in accordance with its Privacy Policy.
`;
}
// Show or hide the button and terms
const isAnyFieldVisible = selectedValue !== "";
document.querySelector('.form-tools').style.display = isAnyFieldVisible ? 'block' : 'none';
document.getElementById('houzez-register-btn').style.display = isAnyFieldVisible ? 'block' : 'none';
// Initialize intl-tel-input for the phone field
const phoneInput = document.getElementById('phone_number');
if (phoneInput) {
const iti = window.intlTelInput(phoneInput, {
initialCountry: "my", // Default country, will be updated
preferredCountries: [],
utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js" // Optional, for formatting
});
// Function to set the country based on user's location
function setCountryFromLocation() {
fetch('https://ipapi.co/json/') // Get location data based on IP
.then(response => response.json())
.then(data => {
const countryCode = data.country.toLowerCase();
iti.setCountry(countryCode); // Set the country in intl-tel-input
updatePhoneNumber(); // Update hidden input with country code
})
.catch(error => console.error('Error fetching location:', error));
}
function updatePhoneNumber() {
const countryData = iti.getSelectedCountryData();
const countryCode = countryData.dialCode; // Get the dial code
// Set the hidden input field's value
document.getElementById("countryCode").value = countryCode; // Store country code in hidden input
// Ensure the input starts with the + sign
if (!phoneInput.value.startsWith('+')) {
phoneInput.value = '+' + countryCode + phoneInput.value.trim();
}
}
function validatePhoneNumber() {
if (iti.isValidNumber()) {
return true; // Proceed with form submission or any other action
} else {
alert('Please enter a valid phone number.');
return false; // Prevent form submission
}
}
phoneInput.addEventListener("countrychange", updatePhoneNumber);
phoneInput.addEventListener("input", function() {
this.value = this.value.replace(/[^0-9+]/g, ''); // Allow only digits and '+'
});
// Set country based on location on load
setCountryFromLocation();
document.querySelector("#registration-form").addEventListener("submit", function(event) {
if (!validatePhoneNumber()) {
event.preventDefault(); // Prevent submission if invalid
} else {
// Debugging: Log the values before submission
console.log("Phone Number:", phoneInput.value);
console.log("Country Code:", document.getElementById("countryCode").value);
}
});
// Initialize the hidden input value
updatePhoneNumber();
}
});
-->
Reset Password
Please enter your username or email address. You will receive a link to create a new password via email.