var url = 'http://tw.tranews.com/map/dStores.asp?x1=' + latlng.x1 + '&x2=' + latlng.x2 + '&y1=' + latlng.y1 + '&y2=' + latlng.y2;
$.get('proxy.php', {url: url}, function (resp) {
console.log(resp);
}, 'XML');
Excuse me guys, I want to add points in google maps v3 with jQuery callback, but I don't know how can do it. I've searched over the web, but I can't find anything. I n开发者_如何学JAVAeed your help!!!!!! plz!
Have you used the maps api at all? Generally this is pretty simple:
- Have your MAP in JS globally visible
- Your request should return JSON (echo '{lat:1,long:1}')
- And then add a marker to your map
Look around in the google api to fine
TO add a marker to the map you go like this:
var myLatlng = new google.maps.LatLng(resp.lat,resp.long);
var marker = new google.maps.Marker({
position: myLatlng,
title:"Hello World!"
});
// To add the marker to the map, call setMap();
marker.setMap(map); //whereas map is your map object
That's the way i'd do it, to find out more look up the google maps api: http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/overlays.html http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/reference.html#Marker
精彩评论