text: (function(){var c=function(a){""!==a&&(1==a?($("#gis_location_wkt__row").hide(),$("#gis_location_wkt__row1").hide(),$("#gis_location_lat__row").show(),$("#gis_location_lon__row").show(),$("#gis_location_lat__row1").show(),$("#gis_location_lon__row1").show()):($("#gis_location_lat__row").hide(),$("#gis_location_lon__row").hide(),$("#gis_location_lat__row1").hide(),$("#gis_location_lon__row1").hide(),$("#gis_location_wkt__row").show(),$("#gis_location_wkt__row1").show(),2==a?""===$("#gis_location_wkt").val()&&
  $("#gis_location_wkt").val("LINESTRING( , , )"):3==a?""===$("#gis_location_wkt").val()&&$("#gis_location_wkt").val("POLYGON(( , , ))"):6==a&&""===$("#gis_location_wkt").val()&&$("#gis_location_wkt").val("MULTIPOLYGON(( , , ))")))},f=function(a){var b=new jQuery.Deferred,d=S3.gis;setTimeout(function e(){void 0!=d.maps&&void 0!=d.maps[a]?b.resolve("loaded"):"pending"===b.state()&&(b.notify("waiting for JS to load..."),setTimeout(e,500))},1);return b.promise()};$(document).ready(function(){var a=$("#gis_location_gis_feature_type").val();
  c(a);$("#gis_location_gis_feature_type").change(function(){a=$(this).val();c(a)});var b=$("#gis_location_level").val();b&&($("#gis_location_addr_street__row").hide(),$("#gis_location_addr_street__row1").hide(),$("#gis_location_addr_postcode__row").hide(),$("#gis_location_addr_postcode__row1").hide(),"L0"==b&&$("#gis_location_parent__row").hide());$("#gis_location_level").change(function(){var a=$(this).val();a?($("#gis_location_addr_street__row").hide(),$("#gis_location_addr_street__row1").hide(),
  $("#gis_location_addr_postcode__row").hide(),$("#gis_location_addr_postcode__row1").hide(),"L0"==a?($("#gis_location_parent__row").hide(),$("#gis_location_parent__row1").hide(),$("#gis_location_parent").val("")):($("#gis_location_parent__row").show(),$("#gis_location_parent__row1").show())):($("#gis_location_addr_street__row").show(),$("#gis_location_addr_street__row1").show(),$("#gis_location_addr_postcode__row").show(),$("#gis_location_addr_postcode__row1").show(),$("#gis_location_parent__row").show(),
  $("#gis_location_parent__row1").show())});$.when(f("default_map")).then(function(a){var b=S3.gis.maps.default_map;b.s3.pointPlaced=function(a){a=a.geometry.getBounds().getCenterLonLat();a.transform(b.getProjectionObject(),S3.gis.proj4326);$("#gis_location_lon").val(a.lon);$("#gis_location_lat").val(a.lat);$("#gis_location_wkt").val("")}})})})();
  