Подскажите пожалуйста как заменить гугл карты на яндекс в компоненте на джумла3, может кто сталкивался с этой проблемой?
<div class="row_add_house">
<span><?php echo _REALESTATE_MANAGER_LABEL_LATITUDE;?>:</span>
<input class="inputbox" type="text" id="hlatitude" name="hlatitude" size="20"
value="<?php echo $row->hlatitude;?>" readonly/>
</div>
<div class="row_add_house">
<span><?php echo _REALESTATE_MANAGER_LABEL_LONGITUDE;?>:</span>
<input class="inputbox" type="text" id="hlongitude" name="hlongitude" size="20"
value="<?php echo $row->hlongitude;?>" readonly/>
<input type="hidden" id="map_zoom" name="map_zoom" value="<?php echo $row->map_zoom;?>"
/>
</div>
<div class="row_add_house">
<span><?php echo _REALESTATE_MANAGER_LABEL_GEOCOOR; ?></span>
<input type="button" value="<?php echo _REALESTATE_MANAGER_BUTTON_SHOW_ADDRESS; ?>"
onclick="codeAddress()">
</div>
<div class="row_add_house">
<span><?php echo _REALESTATE_MANAGER_LABEL_CLICKMAP; ?>:</span>
<div id="map_canvas" class="re_map_canvas"></div>
<!--Image google map-->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false " type="text/javascript"></script>
<script type="text/javascript">
var map;
var lastmarker = null;
var marker = null;
var mapOptions;
var myOptions = {
zoom: <? php echo $row - > map_zoom; ?> ,
center: new google.maps.LatLng( <? php
if ($row - > hlatitude) echo $row - > hlatitude;
else echo 0; ?> , <? php
if ($row - > hlongitude) echo $row - > hlongitude;
else echo 0; ?> ),
scrollwheel: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var geocoder = new google.maps.Geocoder();
var map = new google.maps.Map(document.getElementById(
"map_canvas"), myOptions);
var bounds = new google.maps.LatLngBounds();
<? php
if ($row - > hlatitude && $row - > hlongitude)
{ ?>
//Set the marker coordinates
var lastmarker = new google.maps.Marker({
position: new google.maps.LatLng( <? php echo $row - >
hlatitude; ?> , <? php echo $row - >
hlongitude; ?> )
});
lastmarker.setMap(map);
<? php
} ?>
//If the zoom, then store it in the field map_zoom
google.maps.event.addListener(map, "zoom_changed", function () {
document.getElementById("map_zoom")
.value = map.getZoom();
});
google.maps.event.addListener(map, "click", function (e) {
//Initialize marker
marker = new google.maps.Marker({
position: new google.maps.LatLng(e.latLng.lat(),
e.latLng.lng())
});
//Delete marker
if (lastmarker) lastmarker.setMap(null);;
//Add marker to the map
marker.setMap(map);
//Output marker information
document.getElementById("hlatitude")
.value = e.latLng.lat();
document.getElementById("hlongitude")
.value = e.latLng.lng();
//Memory marker to delete
lastmarker = marker;
});
function updateCoordinates(latlng)
{
if (latlng)
{
document.getElementById('hlatitude')
.value = latlng.lat();
document.getElementById('hlongitude')
.value = latlng.lng();
document.getElementById("map_zoom")
.value = map.getZoom();
}
}
function toggleBounce() {
if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
function codeAddress() {
myOptions = {
zoom: 14,
scrollwheel: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
},
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById(
"map_canvas"), myOptions);
//var address = document.getElementById('vlocation').value + " " + document.getElementById('country').value+ " " + document.getElementById('region').value+ " " + document.getElementById('city').value+ " " + document.getElementById('zipcode').value;
var address = document.getElementById('hlocation')
.value + " " + document.getElementById('hcountry')
.value + " " + document.getElementById('hregion')
.value + " " + document.getElementById('hcity')
.value + " " + document.getElementById('hzipcode')
.value + " " + document.getElementById('hlatitude')
.value + " " + document.getElementById('hlongitude')
.value;
geocoder.geocode({
'address': address
}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
updateCoordinates(results[0].geometry.location);
if (marker) marker.setMap(null);
marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
draggable: true,
animation: google.maps.Animation.DROP
});
google.maps.event.addListener(marker, 'click',
toggleBounce);
google.maps.event.addListener(marker,
"dragend", function () {
updateCoordinates(marker.getPosition());
});
} else {
alert("Please check the accuracy of Address");
}
});
}
</script>
</div>