PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : استفاده از google Map برای سایت املاک



teztop
January 31st, 2011, 22:03
سلام
من می خوام از نقشه گوگل توی سایت املاکم استفاده کنم. می خوام بشه رو نقشه املاک رو نشانه گذاری کرد. این امکان رو هم می خوام فقط به اعضا بدم که بتونن به نقشه نشانه اضافه کنن. می شه راهنمایی کنین؟
ممنون می شم
املاک آنلاين ، خريد ، فروش ، رهن ، اجاره پيش فروش ، معاوضه و درج آگهي رايگان املاک آپارتمان ويلا شرکت مغازه زمين و .... (http://www.teztop.com):-?

drerror
January 31st, 2011, 22:23
اگر از cms خاصی استفاده می کنید دنبال plugin همون cms باشید

teztop
January 31st, 2011, 22:55
نه cms نیست با پی اچ پی نوشتمش خودم

drerror
February 1st, 2011, 17:22
ببخشید مهارت ندارم توش
از اساتید سوال بپرسید

teztop
February 4th, 2011, 08:52
می شه لطفا راهنمایی کنیید دوستان عزیز ؟؟

Rezash
February 4th, 2011, 21:47
try this :
Using Google Maps API to mark multiple addresses fetched from database PHP and Geocoder (http://arturito.net/2010/12/13/using-google-maps-api-to-mark-multiple-addresses-fetched-from-database-php-and-geocoder/)

teztop
February 4th, 2011, 23:47
آقا رضا ممنون که جواب می دین. من این کارو انجام دادم و اما این خطا را موقع لود می ده
The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false"

Google Maps API Key! راهم ثبت نام کردم و قرار دادم.
آیا نیاز به نصب یا فعال کردن چیزی روی سرور دارم ؟؟؟

Rezash
February 5th, 2011, 00:17
خواهش ميكنم.
اين رو تست كنيد بايد درست بشه :

<script src="http://maps.google.com/maps?file=api&v=2&key=here_we_enter_google_api_key&sensor=false" type="text/javascript"></script>

teztop
February 5th, 2011, 00:29
تغییر دادم خطا برطرف شد اما نقشه گوگل نیست. Index (http://teztop.com/googlemap)

Rezash
February 5th, 2011, 00:33
سورس رو بذار يك چك بكنم.

teztop
February 5th, 2011, 00:34
خیلی ممنون برای پیگیری تون :)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Index</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAYLbtKt9f2r1TKgZ873tFBBSTbocS6Fu6VX66t5 PjLuR8iUzwxBQCiZFtuB-OPUxekO5_JDo0_uksMg&sensor=false" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var map = null;
var geocoder = null;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
geocoder = new GClientGeocoder();
// Here enter your url of ashx file
GDownloadUrl("xml.php", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
showAddress(address,name);
}
});
}
}
function showAddress(address, name) {
if (geocoder) {
geocoder.getLatLng(
name+","+address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = createMarker(point, name, address);
map.addOverlay(marker);
}
});
}
}
function createMarker(point, name, address) {
var marker = new GMarker(point);
var html = "<b>" + name + "</b> <br/>" + address;
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div>
<div id="map" style="width: 1000px; height: 600px"></div>
</div>
</body>
</html>

Rezash
February 5th, 2011, 01:13
خواهش مي كنم.
xml.php محتوياتش رو بذاريد.

teztop
February 5th, 2011, 08:16
<?php
mysql_connect("localhost", "root", " ") or die(mysql_error());
mysql_select_db("googlemap") or die(mysql_error());
$query = "SELECT * FROM markers";
$result = mysql_query($query) or die(mysql_error());
$doc = new DomDocument('1.0');

$node = $doc->createElement("markers");
$parnode = $doc->appendChild($node);
header("Content-type: text/xml");
while($row = mysql_fetch_array($result))
{
$node = $doc->createElement("marker");
$newnode = $parnode->appendChild($node);
$newnode->setAttribute("name", $row['name']);
$newnode->setAttribute("address", $row['address']);
}
print $doc->saveXML();
?>

این رو لوکال هاست سیستمه. روی سرور با نام پایگاه خودش قرار دادم. اگه نیازه اونو هم بدم

Rezash
February 5th, 2011, 12:11
نه منظورم خروجيش بود. خروجيش برام مهمه كه چك كنم آدرس ها درست مقدار دهي ميشند يا نه

teztop
February 5th, 2011, 12:46
سلام
اینجا آدرسشه. Index (http://teztop.com/googlemap/)
Index (http://teztop.com/googlemap)

teztop
February 6th, 2011, 10:51
دوستان اگه ممکنه راهنمایی کنید . ممنون

teztop
February 7th, 2011, 17:27
[-(:106:

Rezash
February 7th, 2011, 20:44
دوست عزيز منظورم خروجي xml بود ! كه البته خودم يافتمش :
http://teztop.com/googlemap/xml.php
يك نگاه بندازيد مشكل واضحه