2012-07-16 27 views
9

में दिशानिर्देश सेवा से मार्कर छुपाएं मैं दो मार्करों के बीच एक मार्ग बनाने के लिए इस सेवा का उपयोग कर रहा हूं https://developers.google.com/maps/documentation/javascript/directionsGoogle नक्शे एपीआई v3

समस्या यह है कि जब मैं पथ बनाने के लिए फ़ंक्शन चलाता हूं, तो वह Google मानचित्र (शुरुआत और अंत) से डिफ़ॉल्ट रूप से दो मार्करों में प्रवेश करता है जब मैंने अलग-अलग शैली के साथ मार्कर बनाए थे।

परिणाम: प्रत्येक बिंदु पर मेरे मार्कर और मार्कर के डिफ़ॉल्ट Google मानचित्र ऊपर हैं।

मैं Google द्वारा बनाए गए मार्कर को कैसे छुपा सकता हूं?

कोड मैं का उपयोग कर रहा है:

function makePathToMarker(position1, position2) { 
    var request = { 
     origin: new google.maps.LatLng(myLocation.split(",")[0],myLocation.split(",")[1]), 
     destination: new google.maps.LatLng(position1, position2), 
     travelMode: google.maps.DirectionsTravelMode.DRIVING 
    }; 

    var directionsService = new google.maps.DirectionsService(); 

    directionsService.route(request, function(response, status) { 
     if (status == google.maps.DirectionsStatus.OK) { 
      directionsDisplay.setDirections(response); 
     } 
    }); 
} 

उत्तर

30

जब DirectionsRenderer instatiating, सत्य पर suppressMarkers निर्धारित किया है।

directionsDisplay = new google.maps.DirectionsRenderer(
    { 
     suppressMarkers: true 
    }); 

यहाँ reference

+0

बहुत बहुत शुक्रिया है! –

+0

मैं इसे कहां जोड़ सकता हूं –

संबंधित मुद्दे