Custom GoogleMaps

Size
2,357 Kb
Views
6,072

How do I make an custom googlemaps?

Adding color and marker. What is a custom googlemaps? How do you make a custom googlemaps? This script and codes were developed by Jimmy Van Der Sleen on 15 January 2023, Sunday.

Custom GoogleMaps Previews

Custom GoogleMaps - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Custom GoogleMaps</title> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="map-canvas"></div> <script src="js/index.js"></script>
</body>
</html>

Custom GoogleMaps - Script Codes CSS Codes

html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px;
}

Custom GoogleMaps - Script Codes JS Codes

var map;
var brooklyn = new google.maps.LatLng(52.221537,6.893662);
var MY_MAPTYPE_ID = 'custom_style';
function initialize() { var featureOpts = [ { stylers: [ { hue: '#999' }, { visibility: 'simplified' }, { gamma: 0.8 }, { weight: 0.1 } ] }, { elementType: 'labels', stylers: [ { visibility: 'on' } ] }, { featureType: 'water', stylers: [ { color: '#339966' } ] } ]; var mapOptions = { zoom: 12, center: brooklyn, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, MY_MAPTYPE_ID] }, mapTypeId: MY_MAPTYPE_ID }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var styledMapOptions = { name: 'Custom Style' }; var image = "http://www.logicrecruitment.nl/wp-content/uploads/icon-user-green.png"; var beachMarker = new google.maps.Marker({ position: brooklyn, map: map, icon: image }); var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions); map.mapTypes.set(MY_MAPTYPE_ID, customMapType);
}
google.maps.event.addDomListener(window, 'load', initialize);
Custom GoogleMaps - Script Codes
Custom GoogleMaps - Script Codes
Home Page Home
Developer Jimmy Van Der Sleen
Username sjimster
Uploaded January 15, 2023
Rating 3
Size 2,357 Kb
Views 6,072
Do you need developer help for Custom GoogleMaps?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jimmy Van Der Sleen (sjimster) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!