Cibiņš Posted July 11, 2011 Report Share Posted July 11, 2011 Kā var ievietot google maps maršrutus? Teiksim kad mājaslapā apmeklētājam tiek piedāvāts izveidot maršrutu uz google maps kartes, kas integrēta lapā, piedāvājot arī maršrutu saglabāt. Lietotājs mājaslapā piedāvātajā kartē atzīmē punktus un izveido maršrutu, kā arī pievieno aprakstus un maršrutu saglabā. Varbūt ir kāds tutorials šai operācijai? Quote Link to comment Share on other sites More sharing options...
NBS Posted July 11, 2011 Report Share Posted July 11, 2011 Vari paspēlēties: http://code.google.com/apis/ajax/playground/ Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 11, 2011 Author Report Share Posted July 11, 2011 (edited) Vari paspēlēties: http://code.google.com/apis/ajax/playground/ Paldies šis man kādreiz noderēs, bet tas tomēr man īsti neder :( Vajag ar iespēju pievienot objektu, aprakstu, veidot maršrutu un saglabāt visu. :( Varbūt vēl kāds zin kur ir kāds tutorials ar mar maršrutu veidošanu google maps kartēs un iespēju saglabāt maršrutu - protams - manās mysql datubāzēs? Edited July 11, 2011 by Cibiņš Quote Link to comment Share on other sites More sharing options...
NBS Posted July 11, 2011 Report Share Posted July 11, 2011 Vecīt tur viss ir, pašam tāds brīnums jātaisa, ka saglabā db utt. Šaubos, ka atradīsi kaut ko gatavu un labu. Quote Link to comment Share on other sites More sharing options...
rpr Posted July 11, 2011 Report Share Posted July 11, 2011 meklē google maps api sādas lietas: polyline marker infowindow Quote Link to comment Share on other sites More sharing options...
daGrevis Posted July 11, 2011 Report Share Posted July 11, 2011 Pasviedi ideju! Paldies. Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 11, 2011 Author Report Share Posted July 11, 2011 Kaut cikju kautko te..neesmu profs google maps padziļinājumā, taču problēma ir tāda ka nodzēst tos puļķus nevar. Pievienot var - pārvietot var, nodzēst - nep :( Var kāds LŪŪDZŪŪŪŪŪŪŪ papildināt rindiņu? :( var riga = new google.maps.LatLng(56.878999, 24.455566); var neighborhoods = [ new google.maps.LatLng(56.946250, 24.104494) ]; var markers = []; var markersArray = []; var map; function initialize() { var mapOptions = { zoom: 7, mapTypeId: google.maps.MapTypeId.HYBRID, center: riga }; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); google.maps.event.addListener(map, 'click', function(event) { addMarker(event.latLng); }); } function addMarker(location) { marker = new google.maps.Marker({ position: location, map: map, draggable: true, animation: google.maps.Animation.DROP }); markersArray.push(marker); } Quote Link to comment Share on other sites More sharing options...
waplet Posted July 11, 2011 Report Share Posted July 11, 2011 Aizstum ārpus redzes loka :) Quote Link to comment Share on other sites More sharing options...
rpr Posted July 12, 2011 Report Share Posted July 12, 2011 markerus nevar dzeest, var uztaisiit par hidden. Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 12, 2011 Author Report Share Posted July 12, 2011 A kā tad šitie ar dubultklikšķi pazūd?? http://code.google.com/apis/ajax/playground/#map_google_north_america_offices Quote Link to comment Share on other sites More sharing options...
waplet Posted July 12, 2011 Report Share Posted July 12, 2011 function deleteMarker() { var markerNum = parseInt(document.getElementById("markerNum").value); mgr.removeMarker(allmarkers[markerNum]); } Quote Link to comment Share on other sites More sharing options...
codez Posted July 12, 2011 Report Share Posted July 12, 2011 (edited) waplet, nepareizi. Dubultkliksķis un tā izsauktā anonīmā funkcija ir šajā koda gabalā: GEvent.addListener(marker, 'dblclick', function() { mgr.removeMarker(marker) } ); Edited July 12, 2011 by codez Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 12, 2011 Author Report Share Posted July 12, 2011 (edited) Bet runa nav par anonīmo marķieri bet ir par konkrētu marķieri. Es nezinu un neredzu, kādi mainīgie tiek padoti uz kādiem marķieriem un kā izsaukt noņemšanu vai marķiera slēpšanu. Tiešām neviens nezin? Tiešām vēlos lai kāds pieliek klāt dzēšanas rindiņu lai redzu kas īsti ir kas un pamazām sāku apjēgt to padarīšanu. Edited July 12, 2011 by Cibiņš Quote Link to comment Share on other sites More sharing options...
codez Posted July 12, 2011 Report Share Posted July 12, 2011 Runa tiešām nav par anonīmo marķieri, bet gan par anonīmo funkciju. Lai izdzēstu marķieru, to izdara ar mgr.removeMarker(marker) kur mgr ir marķieru menidžera objekta instance, kuru iegūst to izveidojot: mgr = new MarkerManager(map, {trackMarkers:true}); marker ir marķiera instance, kur iegūst to izveidojot: var marker = new GMarker(posn, {title: title, icon: icon, draggable:true }); Quote Link to comment Share on other sites More sharing options...
rpr Posted July 12, 2011 Report Share Posted July 12, 2011 setVisible(false); un tavs markers no kartes pazūd. tā arī visa dzēšana. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.