OpenStreetMap embedded in your application
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
@srod : Thanks 
@ts-soft : Thanks
@Rook Zimbabwe : Thanks
Keep me informed 
@SFSxOI Yes, that use PB 4.40 beta 1. I think that runs with beta2.
@netmaestro :
I use Dependancy Walker for viewing all dependances of exe file. (http://www.dependencywalker.com/)
And my application uses these dlls : MSVCR90.DLL.
Could you install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) and see the result ?
Source > in French

@ts-soft : Thanks

@Rook Zimbabwe : Thanks


@SFSxOI Yes, that use PB 4.40 beta 1. I think that runs with beta2.
@netmaestro :
I have found some clues on Internet.netmaestro wrote:I dl'd the complete package and tried to run it but I get an error message saying "The application failed to initialize properly (Oxc0150002). What's wrong? (pb 4.4 b2 win xp)
....
Works fine here on Vista but I can't get it to run on XP SP3. Not sure what's missing.
I use Dependancy Walker for viewing all dependances of exe file. (http://www.dependencywalker.com/)
And my application uses these dlls : MSVCR90.DLL.
Could you install Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) and see the result ?
Source > in French
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Installing Visual C++ 2008 did indeed resolve the error message
"The application failed to initialize properly (0xc0150002)"
under Windows XP, but I now get a different error. Any ideas as to the cause?
Run-time error: The specified "Memory ID" is not valid.
in the line: FreeMemory(*LibCurl_SharedMem)
in procedure: RW_LibCurl_InitData()
in module: RW_LibCurl_Inc.pb
when ran with the debugger on from LibCurl.pb or OpenStreetMap.pb
under Windows XP SP2 and PB4.40B2
Stack trace (line numbers may differ slightly from your version):
Line 253
OpenStreetMap.pb
OSM_GetImage(3, 7, 65, 4)
Line 186
OpenStreetMap.pb
RW_LibCurl_InitData()
Current code position:
Line 89
RW_Lib_Curl_Inc.pb
"The application failed to initialize properly (0xc0150002)"
under Windows XP, but I now get a different error. Any ideas as to the cause?
Run-time error: The specified "Memory ID" is not valid.
in the line: FreeMemory(*LibCurl_SharedMem)
in procedure: RW_LibCurl_InitData()
in module: RW_LibCurl_Inc.pb
when ran with the debugger on from LibCurl.pb or OpenStreetMap.pb
under Windows XP SP2 and PB4.40B2
Stack trace (line numbers may differ slightly from your version):
Line 253
OpenStreetMap.pb
OSM_GetImage(3, 7, 65, 4)
Line 186
OpenStreetMap.pb
RW_LibCurl_InitData()
Current code position:
Line 89
RW_Lib_Curl_Inc.pb
Anthony Jordan
@netmaestro : Good news 
@akj : Plz, Could you replace your old function RW_LibCurl_InitData() with this new one :

@akj : Plz, Could you replace your old function RW_LibCurl_InitData() with this new one :
Code: Select all
Procedure RW_LibCurl_InitData()
Shared *LibCurl_SharedMem
If *LibCurl_SharedMem
FreeMemory(*LibCurl_SharedMem)
*LibCurl_SharedMem = 0
EndIf
EndProcedure
Here's how to add a minimise button to the main window.
In OpenStreetMap.pb:
Changeto
Changeto
Changeto
In OpenStreetMap.pb:
Change
Code: Select all
If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
Code: Select all
If OpenWindow(#Window_0, 260, 225, 700, 571, "OpenStreetMap", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
Code: Select all
If CatchImage(0, plImageMem)
SetGadgetState(#Image_0+Image, ImageID(0))
FreeImage(0)
FreeMemory(plImageMem)
Code: Select all
If CatchImage(image, plImageMem)
SetGadgetState(#Image_0+Image, ImageID(image))
FreeMemory(plImageMem)
Code: Select all
If CatchImage(0, plMemory, MemorySize(plMemory))
SetGadgetState(#Image_0+Image, ImageID(0))
FreeImage(0)
FreeMemory(plMemory)
Code: Select all
If CatchImage(image, plMemory, MemorySize(plMemory))
SetGadgetState(#Image_0+Image, ImageID(image))
FreeMemory(plMemory)
Anthony Jordan
@All : I updated the package :
http://partage.rootslabs.net/SourceCode_OSM.zip
@akj ; See the code and say me if it was what you wanted...
@Xombie : I don't understand your request... more explanations, please
http://partage.rootslabs.net/SourceCode_OSM.zip
Code: Select all
ADDED : Mimize Window
ADDED : Zoom with click on the ImageGadget
@Xombie : I don't understand your request... more explanations, please

-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: OpenStreetMap embedded in your application
Hi,
you could add support for Mac OS, if you use this snippet in RW_LibCurl_Inc.pb from line 12 on:
For Mac OS X, you have to change add a "_" before the name of the function:
"curl_easy_init", "curl_easy_setopt", "curl_easy_perform", "curl_easy_cleanup"
become
"_curl_easy_init", "_curl_easy_setopt", "_curl_easy_perform", "_curl_easy_cleanup"
Now it compiles correctly, but won't display any map-data.
you could add support for Mac OS, if you use this snippet in RW_LibCurl_Inc.pb from line 12 on:
Code: Select all
CompilerCase #PB_OS_MacOS
Macro SymbolName(Val)
DQuote#Val#DQuote
EndMacro
#LibCurl_ImportLib = "/usr/lib/libcurl.3.dylib"
#LibCurl_SeparatorDir = "/"
"curl_easy_init", "curl_easy_setopt", "curl_easy_perform", "curl_easy_cleanup"
become
"_curl_easy_init", "_curl_easy_setopt", "_curl_easy_perform", "_curl_easy_cleanup"
Now it compiles correctly, but won't display any map-data.
Regards,
JamiroKwai
JamiroKwai
Re: OpenStreetMap embedded in your application
It compiles well from my side, but when running with PB 4.41 and Windows XP SP3 with 4Gb RAM, it crashes when it tries to allocate memory in RW_LibCurl_GetData : [ERROR] The specified MemoryID is NULL (Line 149 RW_LibCurl_inc.pb), this line :
Any idea ?
Code: Select all
*LibCurl_NewMemory = AllocateMemory(MemorySize(*LibCurl_SharedMem))
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
Re: OpenStreetMap embedded in your application
http://vimeo.com/14579414
program based on (this) discussion:
http://purebasic.fr/english/viewtopic.p ... 217ca777be
but significantly modified:
multi-threaded
accelerated graphics
mouse control
program based on (this) discussion:
http://purebasic.fr/english/viewtopic.p ... 217ca777be
but significantly modified:
multi-threaded
accelerated graphics
mouse control
Re: OpenStreetMap embedded in your application
Don't hesitate to give your code... I will improve the package and put your credits... Very good job... But what can't do PB ?