Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Can't remove a single marker #153

Description

@adam-jones-net

I have setup some maps with popup info windows and that works fine. However now that I need to interact with existing markers I am having trouble. I've seen very brief explanations of how to use setMap(null) but they haven't helped me.

Can someone clarify with a fuller example? My setup code is as follows...

var infoWindows = [];
var locations=[
	{id:'marker1', position:[51.528308,-0.3817765],content:'test content',icon:'assets/mappointer.png'}
]
var map=$('#mapDiv').gmap3({
	mapTypeId: "teststyle",
	scrollwheel: true
})
.marker(locations)
.infowindow(locations)
.then(function (infowindow) {
	// handle click events for each marker
	var map = this.get(0);
	var marker = this.get(1);
	marker.forEach(function(item,i){
		item.addListener('click', function() {
			infowindow[i].open(map, item);
			infoWindows.push(infowindow[i]);
		});
	})
})
.styledmaptype("teststyle",mapStyle)
.fit();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions