﻿  var g_geocoder = null;
  var g_map;

  function googlemap_initialize() {
      g_geocoder = new google.maps.Geocoder();
      var latlng = new google.maps.LatLng(48.856614, 2.3522219000000177);
    var myOptions = {
      zoom: 16,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.HYBRID
    }
    g_map = new google.maps.Map(document.getElementById("googlemap"), myOptions);
  }

  function googlemap_codeAddress(addressStr) {
      var address = addressStr;
      if (g_geocoder == null) {
          return;
      }
      g_geocoder.geocode({ 'address': address }, function (results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
              g_map.setCenter(results[0].geometry.location);
              var marker = new google.maps.Marker({
                  map: g_map,
                  position: results[0].geometry.location
              });

              var point = results[0].geometry.location;

              j$("#ur_pf_Location_Lat").text(point.lat().toFixed(5));
              j$("#ur_pf_Location_Lng").text(point.lng().toFixed(5));
              j$("#edit_ur_location").val(address);

          } else {
              alert(g_tr.ggl_address_err + status);
          }
      });
  }

