Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- marker.bindPopup(content).openPopup();
- marker.updatePopup(newContent);
- //marker creation
- var marker = L.marker([44.63, 22.65]).bindPopup('something').addTo(map);
- marker.openPopup();
- //changing the content on mouseover
- marker.on('mouseover', function(){
- marker._popup.setContent('something else')
- });
- $('button').click(function() {
- // Update the contents of the popup
- $(popup._contentNode).html('The new content is much longer so the popup should update how it looks.');
- // Calling _updateLayout to the popup resizes to the new content
- popup._updateLayout();
- // Calling _updatePosition so the popup is centered.
- popup._updatePosition();
- return false;
- });
Add Comment
Please, Sign In to add comment