+ Start a Discussion
Baba GBaba G 

Getting error in coding when trying to show multiple contact location of an account in sfdc

Getting an error Visualforce Page
[Error] Error: Unknown property 'String.Name'

and code is as blow:

<apex:page Controller="AccountList" sidebar="false">
    <script type="text/javascript"
        #map {
            font-family: Arial;
            line-height:normal !important;
            padding: 20px;
            /* outer shadows  (note the rgba is red, green, blue, alpha) */
            -webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.4); 
            -moz-box-shadow: 0px 1px 6px rgba(23, 69, 88, .5);
            /* rounded corners */
            -webkit-border-radius: 12px;
            -moz-border-radius: 7px; 
            border-radius: 7px;
            /* gradients */
            background: -webkit-gradient(linear, left top, left bottom, 
            color-stop(0%, white), color-stop(15%, white), color-stop(100%, #D7E9F5)); 
            background: -moz-linear-gradient(top, white 0%, white 55%, #D5E4F3 130%); 
    <script type="text/javascript">                   
        var geocoder;
        var map;
        var infowindow = new google.maps.InfoWindow();
        var places = [];
        var title_content = new Array();                    
        var popup_content = new Array();                    
        var address = new Array();
        var address_position = 0;                    
        var timeout = 600;
        function initialize(){
            geocoder = new google.maps.Geocoder();
            var latlng = new google.maps.LatLng(29.01, 77.38);
            var myOptions = {
              zoom: 2,
              center: latlng,
              mapTypeId: 'roadmap'
            <apex:repeat value="{!objAccounts}" var="loc" id="addressesId">
                title_content.push("Name: "+"{!loc.Name}"+" \nClick for more Detail");                 
                address.push("{!loc.BillingStreet}, {!loc.BillingCity}, 
                popup_content.push("<b>Account Name: {!loc.Name}
                +"<br/>Street: {!loc.BillingStreet}"
                +"<br/>City: {!loc.BillingCity}<br/>Postal Code: {!loc.BillingPostalCode}"+
                +"<br/>Country: {!loc.BillingCountry }</b>");                                                    
            map = new google.maps.Map(document.getElementById("map"), myOptions);
        function addMarker(position){
            geocoder.geocode({'address': address[position]}, function(results, status){
                if (status == google.maps.GeocoderStatus.OK) {
                    places[position] = results[0].geometry.location;                                    
                    var marker = new google.maps.Marker({
                        position: places[position],
                        icon: getMapIconUrl(position+1),
                        map: map
                    google.maps.event.addListener(marker, 'click', function() {
                        if (!infowindow) {
                            infowindow = new google.maps.InfoWindow();
                        infowindow.open(map, marker);
                    if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT){
                        setTimeout(function() { addMarker(position); }, (timeout * 3));
                if (address_position < address.length){
                    setTimeout(function() { addMarker(address_position); }, (timeout));
            @Description: To Put diffren color image on Google Map
            @Param: Marker Number to Add on map.
        function getMapIconUrl(markerNumber){
            if(markerNumber > 21){
                markerNumber = markerNumber%20;
            var mapIconUrl = "{!URLFOR($Resource.GoogleMarkers, 'GoogleMark/1.png')}";
            var newIcon = markerNumber+'.png';
            mapIconUrl = mapIconUrl.replace('1.png',newIcon);
            return mapIconUrl;
    <apex:pageMessages />
    <div id="map" class="roundCornerCss"></div>   
MJ Kahn / OpFocusMJ Kahn / OpFocus
It'll help to see the controller code.

Also, when you're having an error like this, where the compiler doesn't tell you where the error is, it's often useful to remove blocks of code, line by line, until the compiler stops complaining. 
what is the type objAccounts ;property in your Account Contoller?. it should be List<Account>