Hi there,
I build site using D7 + Views + Leaflet 7.x-1.3. For it I created my custom map with unique design using TileMill, than export to PNG and slice to tiles using "Photoshop Google Maps Tile Cutter". So, I created new custom module for it and use custom_map_leaflet_map_info() function. All is good, I see my map, but for now all coordinates for my markers is broken. I am newbie, but I think the matter in bounds. The TileMill in project settings use next bounds -180,-58.9953,180,84.3022
Hi can I set it for my map?

Thx for any answer!
Regards, Anatolii.

Comments

trolik created an issue. See original summary.

yash_khandelwal’s picture

Below is example to set a map.

<div id="googleMap" style="height:400px;width:100%;"></div>

<!-- Add Google Maps -->
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
    var myCenter = new google.maps.LatLng(22.7541475, 75.8972077);

    function initialize() {
        var mapProp = {
            center: myCenter,
            zoom: 12,
            scrollwheel: false,
            draggable: false,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);

        var marker = new google.maps.Marker({
            position: myCenter,
        });

        marker.setMap(map);
    }

    google.maps.event.addDomListener(window, 'load', initialize);
</script>
trolik’s picture

Hello Yash Khandelwal, thx for answer. But I need only information about Leaflet bounds.

yash_khandelwal’s picture

For Leaflet bounds..

var group = new L.featureGroup([marker1, marker2, marker3]);
map.fitBounds(group.getBounds());

See here for more info.

yash_khandelwal’s picture

Status: Active » Closed (works as designed)
yash_khandelwal’s picture

yash_khandelwal’s picture

Status: Closed (works as designed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

yash_khandelwal’s picture