mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 918 forks source link

Is possible add a marker without Native INFO WINDOW? #2824

Closed fafvaz closed 4 years ago

fafvaz commented 4 years ago

Hello,

Im trying to add a list of markers, but i want to hide the INFO Window (onclick) i already hide using the (marker.hideInfoWindow();) on _MARKERCLICK but the behavior is a little bit strange.

How i can add the marker and set the default value for the INFO Window?

Best Regards.

wf9a5m75 commented 4 years ago
let marker = map.addMarker({
     position : ...,
     myValue : "something"
});

console.log(marker.get("myValue"));
fafvaz commented 4 years ago

Hi @wf9a5m75, thanks for the fast reply.

My question is how to hide the Ballon on the marker. Like a default value (this marker is to show/hide) and only changed by the methods (marker.showInfoWindow(); and marker.hideInfoWindow();)

image

wf9a5m75 commented 4 years ago

What do you mean of without Native INFO WINDOW?

fafvaz commented 4 years ago

The infoballon with the information about the marker.

wf9a5m75 commented 4 years ago

I asked what are you pointing "without"?

If you write like this,

let marker = map.addMarker({
   'title': 'something'
});
marker. showInfoWindow();

the native info window will be displayed.


But you asked without native infoWindow.

I'm not sure what you want to know.

wf9a5m75 commented 4 years ago

There are two types InfoWindow in this plugin.

Using title and/or snippet properties, you can show the native info window, which is provided by Google, and you can not use HTML tags.

HTMLInfoWindow is provided by this plugin, and you can use HTML tags.

fafvaz commented 4 years ago

I asked what are you pointing "without"?

If you write like this,

let marker = map.addMarker({
   'title': 'something'
});
marker. showInfoWindow();

the native info window will be displayed.

But you asked without native infoWindow.

I'm not sure what you want to know.

If i dont fill the title and/or snippet, the native info window will not be shown?

fafvaz commented 4 years ago

Yes that's it 👍 thank you.

karimBenBechir commented 3 years ago

Yes that's it 👍 thank you.

That's not true my dear, removing title and snippet does not remove the infowindow. You have to add : const marker: Marker = this.map.addMarkerSync(point); marker.hideInfoWindow();