Я новичок в угловых js.Now, я работаю над угловыми картами google. У меня есть код в javascript. Я хочу, чтобы он преобразовывался в угловые js. Пусть кто-нибудь мне поможет. Заранее спасибо ..Угловая js Интеграция карты
вот мой HTML-код: -
<div id="map-canvas"></div>
<div class="modal fade" id="geoTagConfirmationModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Geo Tag</h4>
</div>
<div class="modal-body">
<p>Do you want to geotag at this place?…</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" >No</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="doGeoTagging()">Yes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
вот мой код Javascript ..
<script>
var geocoder;
var map;
var infowindow = new google.maps.InfoWindow();
var currPosition;
var geoCodeResults;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(40.730885,-73.997383);
var mapOptions = {
zoom: 18,
center: latlng,
mapTypeId: 'roadmap'
}
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
google.maps.event.addListener(map, 'click', function(e) {
codeLatLng(e.latLng, map);
});
}
function codeLatLng(position,map) {
geocoder.geocode({'latLng': position}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
geoCodeResults=results[0];
currPosition=position;
$('#geoTagConfirmationModal').modal('toggle');
} else {
alert('No results found');
}
} else {
alert('Geocoder failed due to: ' + status);
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);
function doGeoTagging(){
//map.setZoom(11);
var marker = new google.maps.Marker({
position: currPosition,
map: map
});
//infowindow.setContent(results[1].formatted_address);
infowindow.setContent("Geotagging done at "+geoCodeResults.formatted_address+"!");
infowindow.open(map, marker);
return true;
}
</script>
Итак, какова ваша фактическая проблема, с которой вы сталкиваетесь? – OceansOnPluto