Ils on changer la naming convention de leurs fonctions
J'ais eu le meme probleme:
renome toutes tes fonction "get_position " par "getPosition"
Sa devrais marcher,
Gael Langlais
turbobusa dotnet wrote:
> Bonjour j'ai un bug avec google map api v3,
> j'utilise en plus de googlemap jquery sur mes pages si jamais,
> voilà le code que j'utilise pour affiche la map et retourner l'adresse
> gräce au marqueur :
>
> <script type="text/javascript">
> // fonctions pour la google map
> var geocoder = new google.maps.Geocoder();
>
> function geocodePosition(positionMap) {
> geocoder.geocode({
> latLng: positionMap
> }, function(responses) {
> if (responses && responses.length > 0) {
> updateMarkerAddress(responses[0].formatted_address);
> } else {
> updateMarkerAddress('Cannot determine address at
> this location.');
> }
> });
> }
>
> function updateMarkerPosition(latLng) {
> document.form_ajout_article.lat.value = latLng.lat();
> document.form_ajout_article.lon.value = latLng.lng();
> }
>
> function updateMarkerAddress(str) {
> document.form_ajout_article.localisation.value = str;
> }
>
> function initialize() {
> var latLng = new google.maps.LatLng(48.850, 2.336);
> var map = new google.maps.Map(document.getElementById
> ('mapCanvas'), {
> zoom: 8,
> center: latLng,
> mapTypeId: google.maps.MapTypeId.ROADMAP
> });
> var marker = new google.maps.Marker({
> position: latLng,
> title: 'Point A',
> map: map,
> draggable: true
> });
>
> // Update current position info.
> updateMarkerPosition(latLng);
> geocodePosition(latLng);
>
> // Add dragging event listeners.
> google.maps.event.addListener(marker, 'dragstart',
> function() {
> updateMarkerAddress('Dragging...');
> });
>
> google.maps.event.addListener(marker, 'drag', function()
> {
> updateMarkerPosition(marker.get_position());
> });
>
> google.maps.event.addListener(marker, 'dragend', function
> () {
> geocodePosition(marker.get_position());
> });
> }
>
> // Onload handler to fire off the app.
> google.maps.event.addDomListener(window, 'load',
> initialize);
> </script>
>
> Le problème c'est que lorsqu'on clique sur le marqueur pour changer de
> lieu et pointer sur une autre ville par exemple, il ne retourne rien
> et de plus impossible de faire un drag & drop du marqueur car le
> marqueur reste "accroché" au pointeur de la souris
>
> J'espère que vous comprendrez mon bug, je suspecte la fonction
> updateMarkerPosition(marker.get_position()); d'où vient le problème,
> j'espère que vous pourrez m'aider
>
> merci bonne journée
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.