0

I try to add my custom icon via mapIcon attr but doesn't work:

<script type="text/javascript">

    function fc_addressint_initMap(mapBox)
    {
        var mapLatLon = eval("(" + mapBox.attr("data-maplatlon") + ")");
        var mapZoom   = parseInt(mapBox.attr("data-mapzoom"));
        var mapAddr   = mapBox.attr("data-mapaddr");
        var mapType   = eval("(" + mapBox.attr("data-maptype") + ")");
        var mapContent= eval("(" + mapBox.attr("data-mapcontent") + ")");
    var mapIcon = mapBox.attr("data-mapicon");
        var theMap = new google.maps.Map(document.getElementById(mapBox.attr("id")), {
            center: mapLatLon,
            scrollwheel: false,
            zoom: mapZoom,
            mapTypeId: mapType,
            zoomControl: true,
            mapTypeControl: false,
            scaleControl: false,
            streetViewControl: false,
      icon: mapIcon,
            rotateControl: false

        });
        mapBox.addClass("has_fc_google_maps_map");
        mapBox.data("google_maps_ref", theMap);
        var myInfoWindow = new google.maps.InfoWindow({
            content: mapContent
        });
        var theMarker = new google.maps.Marker({
            map: theMap,
            position: mapLatLon,
            title: mapAddr
        });
        theMarker.addListener("click", function() {
            myInfoWindow.open(theMap, theMarker);
        });
    }
    jQuery(document).ready(function(){
        jQuery(".fc_addressint_map_canvas").each( function() {
            fc_addressint_initMap( jQuery(this) );
    });
    });
    </script>

<div class="fc_addressint_map_canvas has_fc_google_maps_map" data-maplatlon="{lat: 43.650621, lng: 1.64613}" data-mapzoom="16" data-mapaddr="Zone Intercommunale de Piossane, 4 Rue de la Plaine" data-maptype="google.maps.MapTypeId.ROADMAP" data-mapcontent="&quot;<div class=\&quot;address\&quot;>Zone Intercommunale de Piossane, 4 Rue de la Plaine, 31590 Verfeil, France<\/div><div class=\&quot;directions\&quot;><a href=\&quot;https:\/\/maps.google.com\/?cid=15202422981228355462\&quot; target=\&quot;_blank\&quot;>Obtenez la Direction<\/a><\/div>&quot;" data-mapicon="https://mairie-verfeil31-fr.mon.world//images/icons-map/cruce.png" id="map_canvas_etablissment-adresse_0_202" style="min-width: 300px; min-height: 300px; position: relative; overflow: hidden;">
  • thanks for correction – yberges Jun 27 at 12:20
  • Why is this tagged mapbox? Looks like you're using gmaps – AndrewHarvey Jun 28 at 2:14
  • ok i do a mistake ... but already need help regards – yberges Jun 28 at 11:27
  • @AndrewHarvey some idea ? – yberges Jul 2 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.