Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapPins specified at MapView instantiation are not added to map on desktop #2618

Open
rmartin16 opened this issue Jun 6, 2024 · 1 comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support. windows The issue relates to Microsoft Windows support.

Comments

@rmartin16
Copy link
Member

rmartin16 commented Jun 6, 2024

Describe the bug

When MapPins are specified for MapView(..., pins=[MapPin(...)]), they are not displayed on the map for, at least, Windows and Linux.

However, pins that are added later via MapView.pins.add() are displayed.

Steps to reproduce

Run the MapView example app in examples/mapview.

Expected behavior

Specified map pins always display.

Screenshots

No response

Environment

  • Operating System: Windows, Linux
  • Python version: 3.10.11
  • Software versions:
    • Briefcase: 0.3.19.dev193+ga9f7e585
    • Toga: 0.4.5.dev151+gee8a4fe88

Logs

briefcase dev
Date/Time:       2024-06-06 19:32:26 
Command line:    C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\Scripts\briefcase dev -r --log

OS Release:      Windows 10
OS Version:      10.0.22621
Architecture:    AMD64
Platform:        Windows-10-10.0.22621-SP0

Python exe:      C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\Scripts\python.exe
Python version:  3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Virtual env:     True
Conda env:       False

Briefcase:       0.3.19.dev193+ga9f7e585
Target platform: windows
Target format:   None

Environment Variables:
	ALLUSERSPROFILE=C:\ProgramData
	APPDATA=C:\Users\user\AppData\Roaming
	COMMONPROGRAMFILES=C:\Program Files\Common Files
	COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files
	COMMONPROGRAMW6432=C:\Program Files\Common Files
	COMPUTERNAME=VM-WIN11
	COMSPEC=C:\Windows\system32\cmd.exe
	DRIVERDATA=C:\Windows\System32\Drivers\DriverData
	HOMEDRIVE=C:
	HOMEPATH=\Users\user
	LOCALAPPDATA=C:\Users\user\AppData\Local
	LOGONSERVER=\\VM-WIN11
	NUMBER_OF_PROCESSORS=4
	ONEDRIVE=C:\Users\user\OneDrive
	OS=Windows_NT
	PATH=C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\Scripts;C:\Program Files\PowerShell\7;C:\Users\user\.pyenv\pyenv-win\shims;C:\Users\user\.pyenv\pyenv-win\versions\3.9.13;C:\Users\user\.pyenv\pyenv-win\versions\3.8.10;C:\Users\user\.pyenv\pyenv-win\versions\3.10.11;C:\Users\user\.pyenv\pyenv-win\versions\3.11.3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;;C:\Program Files\dotnet\;C:\Program Files\starship\bin\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\PowerShell\7\;C:\Users\user\.pyenv\pyenv-win\bin;C:\Users\user\.pyenv\pyenv-win\shims;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Users\user\.dotnet\tools;C:\Users\user\.dotnet\tools;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin
	PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL
	POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro
	PROCESSOR_ARCHITECTURE=AMD64
	PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
	PROCESSOR_LEVEL=25
	PROCESSOR_REVISION=2100
	PROGRAMDATA=C:\ProgramData
	PROGRAMFILES=C:\Program Files
	PROGRAMFILES(X86)=C:\Program Files (x86)
	PROGRAMW6432=C:\Program Files
	PSMODULEPATH=C:\Users\user\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
	PUBLIC=C:\Users\Public
	PYENV=C:\Users\user\.pyenv\pyenv-win\
	PYENV_HOME=C:\Users\user\.pyenv\pyenv-win\
	PYENV_ROOT=C:\Users\user\.pyenv\pyenv-win\
	SESSIONNAME=Console
	STARSHIP_SESSION_KEY=********************
	STARSHIP_SHELL=pwsh
	SYSTEMDRIVE=C:
	SYSTEMROOT=C:\Windows
	TEMP=C:\Users\user\AppData\Local\Temp
	TMP=C:\Users\user\AppData\Local\Temp
	USERDOMAIN=vm-win11
	USERDOMAIN_ROAMINGPROFILE=vm-win11
	USERNAME=user
	USERPROFILE=C:\Users\user
	VIRTUAL_ENV=C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase
	VIRTUAL_ENV_DISABLE_PROMPT=1
	WINDIR=C:\Windows
	WSLENV=WT_SESSION:WT_PROFILE_ID:
	WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336}
	WT_SESSION=5993d372-c7c0-46fd-8308-c62a40cabc54
	_OLD_VIRTUAL_PATH=C:\Program Files\PowerShell\7;C:\Users\user\.pyenv\pyenv-win\shims;C:\Users\user\.pyenv\pyenv-win\versions\3.9.13;C:\Users\user\.pyenv\pyenv-win\versions\3.8.10;C:\Users\user\.pyenv\pyenv-win\versions\3.10.11;C:\Users\user\.pyenv\pyenv-win\versions\3.11.3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;;C:\Program Files\dotnet\;C:\Program Files\starship\bin\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\PowerShell\7\;C:\Users\user\.pyenv\pyenv-win\bin;C:\Users\user\.pyenv\pyenv-win\shims;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Users\user\.dotnet\tools;C:\Users\user\.dotnet\tools;C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin

pyproject.toml:
[build-system]
requires = ["briefcase"]

[tool.briefcase]
project_name = "Map View"
bundle = "org.beeware.toga.examples"
version = "0.0.1"
url = "https://beeware.org"
license = "BSD license"
author = 'Tiberius Yak'
author_email = "[email protected]"

[tool.briefcase.app.mapview]
formal_name = "Map View"
description = "A testing app"
sources = ['mapview']
requires = [
    '../../core',
]


[tool.briefcase.app.mapview.macOS]
requires = [
    '../../cocoa',
    'std-nslog>=1.0.0',
]

[tool.briefcase.app.mapview.linux]
requires = [
    '../../gtk',
]

[tool.briefcase.app.mapview.windows]
requires = [
    '../../winforms',
]

# Mobile deployments
[tool.briefcase.app.mapview.iOS]
requires = [
    '../../iOS',
    'std-nslog>=1.0.0',
]

[tool.briefcase.app.mapview.android]
requires = [
    '../../android',
]

base_theme = "Theme.MaterialComponents.Light.DarkActionBar"

build_gradle_dependencies = [
    "androidx.appcompat:appcompat:1.6.1",
    "com.google.android.material:material:1.11.0",
    "org.osmdroid:osmdroid-android:6.1.0",
]

# Web deployment
[tool.briefcase.app.mapview.web]
requires = [
    "../../web",
]
style_framework = "Shoelace v2.3"

Briefcase Log:
[19:31:31]                                                                                                                                                             config.py:486
           *************************************************************************                                                                                   config.py:486
           ** WARNING: License Definition for the Project is Deprecated           **                                                                                   config.py:486
           *************************************************************************                                                                                   config.py:486
                                                                                                                                                                       config.py:486
               Briefcase now uses PEP 621 format for license definitions.                                                                                              config.py:486
                                                                                                                                                                       config.py:486
               Previously, the name of the license was assigned to the 'license'                                                                                       config.py:486
               field in pyproject.toml. For PEP 621, the name of the license is                                                                                        config.py:486
               assigned to 'license.text' or the name of the file containing the                                                                                       config.py:486
               license is assigned to 'license.file'.                                                                                                                  config.py:486
                                                                                                                                                                       config.py:486
               The current configuration for the Project has a 'license' field                                                                                         config.py:486
               that is specified as a string:                                                                                                                          config.py:486
                                                                                                                                                                       config.py:486
                   license = "BSD license"                                                                                                                             config.py:486
                                                                                                                                                                       config.py:486
               To use the PEP 621 format (and to remove this warning), specify that                                                                                    config.py:486
               the LICENSE file contains the license for the Project:                                                                                                  config.py:486
                                                                                                                                                                       config.py:486
                   license.file = "LICENSE"                                                                                                                            config.py:486
                                                                                                                                                                       config.py:486
           *************************************************************************                                                                                   config.py:486
                                                                                                                                                                          dev.py:240
           [mapview] Installing requirements...                                                                                                                           dev.py:240
           Installing dev requirements... started                                                                                                                          dev.py:89
                                                                                                                                                                   subprocess.py:827
           >>> Running Command:                                                                                                                                    subprocess.py:827
           >>>     'C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\Scripts\python.exe' -u -X utf8 -m pip install --upgrade ../../core ../../winforms   subprocess.py:827
           >>> Working Directory:                                                                                                                                  subprocess.py:827
           >>>     C:\Users\user\github\beeware\toga\examples\mapview                                                                                              subprocess.py:827
[19:31:32] Processing c:\users\user\github\beeware\toga\core                                                                                                       subprocess.py:195
             Installing build dependencies: started                                                                                                                subprocess.py:195
[19:31:47]   Installing build dependencies: finished with status 'done'                                                                                            subprocess.py:195
             Getting requirements to build wheel: started                                                                                                          subprocess.py:195
[19:31:48]   Getting requirements to build wheel: finished with status 'done'                                                                                      subprocess.py:195
             Installing backend dependencies: started                                                                                                              subprocess.py:195
[19:31:50]   Installing backend dependencies: finished with status 'done'                                                                                          subprocess.py:195
             Preparing metadata (pyproject.toml): started                                                                                                          subprocess.py:195
[19:31:51]   Preparing metadata (pyproject.toml): finished with status 'done'                                                                                      subprocess.py:195
           Processing c:\users\user\github\beeware\toga\winforms                                                                                                   subprocess.py:195
             Installing build dependencies: started                                                                                                                subprocess.py:195
[19:32:06]   Installing build dependencies: finished with status 'done'                                                                                            subprocess.py:195
             Getting requirements to build wheel: started                                                                                                          subprocess.py:195
[19:32:07]   Getting requirements to build wheel: finished with status 'done'                                                                                      subprocess.py:195
             Installing backend dependencies: started                                                                                                              subprocess.py:195
[19:32:08]   Installing backend dependencies: finished with status 'done'                                                                                          subprocess.py:195
             Preparing metadata (pyproject.toml): started                                                                                                          subprocess.py:195
[19:32:10]   Preparing metadata (pyproject.toml): finished with status 'done'                                                                                      subprocess.py:195
           Requirement already satisfied: travertino>=0.3.0 in c:\users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages (from                  subprocess.py:195
           toga-core==0.4.5.dev151+gee8a4fe88) (0.3.0)                                                                                                                              
           Requirement already satisfied: pythonnet>=3.0.0 in c:\users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages (from                   subprocess.py:195
           toga-winforms==0.4.5.dev151+gee8a4fe88) (3.0.3)                                                                                                                          
           Requirement already satisfied: clr-loader<0.3.0,>=0.2.6 in c:\users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages (from           subprocess.py:195
           pythonnet>=3.0.0->toga-winforms==0.4.5.dev151+gee8a4fe88) (0.2.6)                                                                                                        
           Requirement already satisfied: cffi>=1.13 in c:\users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages (from                         subprocess.py:195
           clr-loader<0.3.0,>=0.2.6->pythonnet>=3.0.0->toga-winforms==0.4.5.dev151+gee8a4fe88) (1.16.0)                                                                             
           Requirement already satisfied: pycparser in c:\users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages (from                          subprocess.py:195
           cffi>=1.13->clr-loader<0.3.0,>=0.2.6->pythonnet>=3.0.0->toga-winforms==0.4.5.dev151+gee8a4fe88) (2.21)                                                                   
           Building wheels for collected packages: toga-core, toga-winforms                                                                                        subprocess.py:195
             Building wheel for toga-core (pyproject.toml): started                                                                                                subprocess.py:195
[19:32:12]   Building wheel for toga-core (pyproject.toml): finished with status 'done'                                                                            subprocess.py:195
             Created wheel for toga-core: filename=toga_core-0.4.5.dev151+gee8a4fe88-py3-none-any.whl size=123718                                                  subprocess.py:195
           sha256=380a8b398e9f2dfba9203e4fb84f5acc38d62d7dcf73dcc0d97fc52b4fdee5e9                                                                                                  
             Stored in directory:                                                                                                                                  subprocess.py:195
           C:\Users\user\AppData\Local\Temp\pip-ephem-wheel-cache-vr6p_n1d\wheels\2b\5c\05\b8730b061d2792770c3f2fac20a3a15287f0be5620c7ac13ab                                       
             Building wheel for toga-winforms (pyproject.toml): started                                                                                            subprocess.py:195
[19:32:14]   Building wheel for toga-winforms (pyproject.toml): finished with status 'done'                                                                        subprocess.py:195
             Created wheel for toga-winforms: filename=toga_winforms-0.4.5.dev151+gee8a4fe88-py3-none-any.whl size=383299                                          subprocess.py:195
           sha256=da0413d7c1c89fdebbc662aa94470db624ad2fa01cf28f23b98fb55c1e65f544                                                                                                  
             Stored in directory:                                                                                                                                  subprocess.py:195
           C:\Users\user\AppData\Local\Temp\pip-ephem-wheel-cache-vr6p_n1d\wheels\2e\be\83\163b7d6d6749f4d19cb682b640b17fecd8aee4abfc99123ad9                                       
           Successfully built toga-core toga-winforms                                                                                                              subprocess.py:195
           Installing collected packages: toga-core, toga-winforms                                                                                                 subprocess.py:195
             Attempting uninstall: toga-core                                                                                                                       subprocess.py:195
               Found existing installation: toga-core 0.4.5.dev151+gee8a4fe88                                                                                      subprocess.py:195
               Uninstalling toga-core-0.4.5.dev151+gee8a4fe88:                                                                                                     subprocess.py:195
                 Successfully uninstalled toga-core-0.4.5.dev151+gee8a4fe88                                                                                        subprocess.py:195
             Attempting uninstall: toga-winforms                                                                                                                   subprocess.py:195
               Found existing installation: toga-winforms 0.4.5.dev151+gee8a4fe88                                                                                  subprocess.py:195
[19:32:15]     Uninstalling toga-winforms-0.4.5.dev151+gee8a4fe88:                                                                                                 subprocess.py:195
                 Successfully uninstalled toga-winforms-0.4.5.dev151+gee8a4fe88                                                                                    subprocess.py:195
           ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the          subprocess.py:195
           following dependency conflicts.                                                                                                                                          
           toga-android 0.4.4 requires toga-core==0.4.4, but you have toga-core 0.4.5.dev151+gee8a4fe88 which is incompatible.                                     subprocess.py:195
           Successfully installed toga-core-0.4.5.dev151+gee8a4fe88 toga-winforms-0.4.5.dev151+gee8a4fe88                                                          subprocess.py:195
           >>> Return code: 0                                                                                                                                      subprocess.py:827
           Installing dev requirements... done                                                                                                                             dev.py:89
                                                                                                                                                                          dev.py:250
           [mapview] Starting in dev mode...                                                                                                                              dev.py:250
                                                                                                                                                                   subprocess.py:827
           >>> Running Command:                                                                                                                                    subprocess.py:827
           >>>     'C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\Scripts\python.exe' -c 'import runpy,                                               subprocess.py:827
           sys;sys.path.pop(0);sys.argv.extend([]);runpy.run_module("mapview", run_name="__main__", alter_sys=True)'                                                                
           >>> Working Directory:                                                                                                                                  subprocess.py:827
           >>>     C:\Users\user                                                                                                                                   subprocess.py:827
           >>> Environment Overrides:                                                                                                                              subprocess.py:827
           >>>     PYTHONPATH=C:\Users\user\github\beeware\toga\examples\mapview                                                                                   subprocess.py:827
           >>>     PYTHONMALLOC=default                                                                                                                            subprocess.py:827
           >>>     PYTHONUNBUFFERED=1                                                                                                                              subprocess.py:827
           >>>     PYTHONDEVMODE=1                                                                                                                                 subprocess.py:827
           >>>     PYTHONUTF8=1                                                                                                                                    subprocess.py:827
           ===========================================================================                                                                                    run.py:171
[19:32:17] C:\Users\user\github\beeware\briefcase\venv-3.10-briefcase\lib\site-packages\toga\__init__.py:54: NotImplementedWarning: [Winforms] Not implemented:    subprocess.py:195
           MapView.on_select                                                                                                                                                        
             warnings.warn(NotImplementedWarning(f"[{platform}] Not implemented: {feature}"))                                                                      subprocess.py:195
[19:32:26] Stopping...                                                                                                                                             subprocess.py:761
           Saving log... started                                                                                                                                      console.py:390

Additional context

I cannot test on macOS since I do not have hardware acceleration there.

@rmartin16 rmartin16 added the bug A crash or error in behavior. label Jun 6, 2024
@rmartin16 rmartin16 changed the title MapPins specified at MapView instaniation are not added to map on desktop MapPins specified at MapView instantiation are not added to map on desktop Jun 6, 2024
@freakboy3742 freakboy3742 added linux The issue relates Linux support. windows The issue relates to Microsoft Windows support. labels Jun 6, 2024
@freakboy3742
Copy link
Member

It's worth flagging #2417 here - it's possible this might be a known issue with Leaflet.js. However, the more likely cause is that the startup code isn't deferring the creation of map pins correctly on the web-based implementations of GTK and Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. linux The issue relates Linux support. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

No branches or pull requests

2 participants