How to modify the Maps Widget?

0
Dear all,   I want to slightly modify the standard maps widget by editing the source java script file. Could you please give me a hint where to do this?   Thanks a lot for your advice!   Ralf   Background in case you are interested: choosing Mapbox as the map provider in the widget configuration does not allow me to replace the default style by an own one.
asked
4 answers
1

Ralf,

If you look in your App directory (you can access this via Studio Pro using menu option App → Show App Directory In Explorer), you will see a subdirectory call widgets.  In this directory, you’ll see a single file for all widgets that are part of your app.  Find the Maps widget, copy it somewhere else on your machine and change the file extension to .zip.  Now you can unzip it and have a look around at all of the components of the widget.  You’ll find the javascript files (and some other files) inside of this zip file.

 

Hope that helps you get started.

Mike

answered
1

If you haven’t already, make sure you opened the unzipped directory and selected all of the files/folders inside of it to create your new zip file, like this:

In the past, I have selected the unzipped folder (one level up from the screenshot above) and zipped that.

answered
0

Hi Mike, thanks a lot. This helps and I did my modification to the code. Now I am trying to repack again (as suggested here: Mendix Forum - Questions), rename and place the package (“Maps_Custom.mpk”) into the widget folder.

 

Unfortunately, when synchronizing the app directory again, I get the attached message related to this widget.

 

I suppose that I am missing something when packing the widget. Do you have a hint what to do?

 

Best regards, Ralf

answered
0

Dear Mike, thank you, that solved the issue!

 

Best regards, Ralf

answered