Gmap3 - Forum

Gmap3 exchange platform

You are not logged in.

Ads
(server costs 27.50€ per month)


#1 2012-10-12 12:31:17

k7sourabh
Member
Registered: 2012-10-12
Posts: 2

map is showing only half part

i am using gmap3 in fancybox but my map is showing only half of it, i don't know what's the problem please help me out

this is map div along with css and javascript

<div id="map_div" class="gmap3" ></div>

css

<style>
      .gmap3{
	  
        /*margin: 20px auto;*/
        width: 396px;
        height: 95px;
		float:right;
		margin-right:18px;
      }
        </style>


</script>
<script type="text/javascript">
      $(function(){});
	         
          $('#map_div').gmap3();
		  $('#address').autocomplete({
            source: function() {
              $("#map_div").gmap3({
                action:'getAddress',
                address: $(this).val(),
                callback:function(results){
                  if (!results) return;
                  $('#address').autocomplete(
                    'display', 
                    results,
                    false
                  );
                }
              });
            },
			
            cb:{
              cast: function(item){
                return item.formatted_address;
              },
              select: function(item) {
			  
			  
                $("#map_div").gmap3(
				{action:'clear', name:'marker'},
				{action:'addMarker',latLng:item.geometry.location,
                    map:{center:true},
	           }
	      );
		
				//alert(item.geometry.location);
            var dummyaddress = document.getElementById("address").value;
			var zipcode = getZipcode(dummyaddress);
			if(zipcode!=''){
			var nzipcode = zipcode.replace(',', '');
			//alert(nzipcode);
			document.getElementById('valid_zipcode').value = nzipcode;
			}
			
			function getZipcode(address){
			var matches
			var matches = address.match(/[, ](\d){5}[, ]/g);
			if(matches && matches.length>0){
			return matches[0];
			}else{
			return 0;	
			}

		}
  }
            }
          })
          .focus();
          
      
    </script>

Offline

Ads
(server costs 27.50€ per month)


Board footer

Powered by FluxBB