JSFiddle - React, Tailwind, and code Playground

HTML

<script src="//maps.googleapis.com/maps/api/js?libraries=places&amp;amp;sensor=true"></script>
<div style="width: 500px; height: 500px;" id="map1"></div>
<div  style="width: 500px; height: 500px;" id="map2"></div>

JavaScript

var maps = {
    "propertyLocation": {
        "mapElement": "#map1",
        "options": {
            "zoom": 10,
            "streetViewControl": false
        },
        "pins": [
            {
                "title": "Test 1",
                "lat": "52.1975331616",
                "long": "0.9771180153"
            }
        ]
    },
    "localArea": {
        "mapElement": "#map2",
        "options": {
            "zoom": 14,
            "streetViewControl": false
        },
        "pins": [
            {
                "title": "Test 2",
                "lat": "52.1975331616",
                "long": "0.9771180153"
            }
        ]
    }
};

// Sensible defaults
var defaults = {
    zoom: 9,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    draggable: true
};

for (var i in maps) {    
    // Extend the options
    var opts = $.extend(true, defaults, maps[i].options),
        marker,
        map,
        bounds = new google.maps.LatLngBounds();
    
    // Create the map
    map = new google.maps.Map($(maps[i].mapElement)[0], opts);
    
    
    // Create all pins
    for (var p = 0; p < maps[i].pins.length; p++) {
        var pin = maps[i].pins[p];
        marker = new google.maps.Marker({
            position: new google.maps.LatLng(pin.lat, pin.long),
            map: map,
            title: pin.title,
            icon: pin.icon
        });
        
        // Extend the bounds of the map to contain the marker
        bounds.extend(marker.position);
    };
    
    // If no center option has been specified, center the map to
    // contain all pins and reset the zoom
    var listener = new google.maps.event.addListenerOnce(map, "bounds_changed", function () {
        if (!opts.center) {
            map.setZoom(opts.zoom);
        };
    });
    map.fitBounds(bounds);
}