Running GIS plugin on html/javascript - map

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

image

The html div

Impor****ts :

$( document ).ready( function() { $('head').append(''); **What I see on Google Chrome :** ![image](upload://3o8Bv1IJLWr3xhwvfl8ZNaZuBT5.png)

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});

image

image

···

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi Ramon,

Try this setup:

image

image

···

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

Hi Bjørn,

Thank you for your quick answer, I tried that but I have the same problem. (I don’t think it’s a problem of authentication since my script is inside the platform (it’s an HTML standard report)).

However, I got on the console some other errors but I don’t know if it’s related.

Thank you !

PS: Here’s the result and the console

image

image

image

···

2017-05-15 15:58 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi Ramon,

Try this setup:


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi,

By looking at your screenshoot, it seems like you’re loading version 2.22 (or before) of the GIS app.

This version is no longer supported. Could you test with DHIS 2.26?

Bjørn

image

image

image

···

On Mon, May 15, 2017 at 4:51 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi Bjørn,

Thank you for your quick answer, I tried that but I have the same problem. (I don’t think it’s a problem of authentication since my script is inside the platform (it’s an HTML standard report)).

However, I got on the console some other errors but I don’t know if it’s related.

Thank you !

PS: Here’s the result and the console

2017-05-15 15:58 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi Ramon,

Try this setup:


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

Hi sorry!

Yes, I wrote the answer too fast. I’m trying now with 226 for maps and 222 for the others :slight_smile:

image

image

image

···

2017-05-15 16:58 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi,

By looking at your screenshoot, it seems like you’re loading version 2.22 (or before) of the GIS app.

This version is no longer supported. Could you test with DHIS 2.26?

Bjørn

On Mon, May 15, 2017 at 4:51 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi Bjørn,

Thank you for your quick answer, I tried that but I have the same problem. (I don’t think it’s a problem of authentication since my script is inside the platform (it’s an HTML standard report)).

However, I got on the console some other errors but I don’t know if it’s related.

Thank you !

PS: Here’s the result and the console


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-15 15:58 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi Ramon,

Try this setup:


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn

image

image

image

···

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi Bjorn !

Thank you for your answer.

  1. Yes it is, It’s running on v2.26 but I don’t see why the 2.26 map plugin would use the 2.22 version of the Web API.

  2. I changed the basemap to googleStreets but nothing changed.

  3. The div is already 400x300px in CSS.

Thank you for your help.

I see you added a task to make work the sample site:

https://play.dhis2.org/portal/map.html

I think it would be great. Thank you for your work and your help!

image

image

image

···

2017-05-17 23:22 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hi Bjorn !

update: That works ! At you said, if I specify the height in the css that works ! But I have to do it directly on the html div (style=“height: 300px”) because the plugin overwrites the class of the div :frowning:

Thank you for your help !

image

image

image

···

2017-05-23 9:36 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hi Bjorn !

Thank you for your answer.

  1. Yes it is, It’s running on v2.26 but I don’t see why the 2.26 map plugin would use the 2.22 version of the Web API.
  1. I changed the basemap to googleStreets but nothing changed.
  1. The div is already 400x300px in CSS.

Thank you for your help.

I see you added a task to make work the sample site:

https://play.dhis2.org/portal/map.html

I think it would be great. Thank you for your work and your help!

2017-05-17 23:22 GMT+02:00 Bjørn Sandvik bjorn@dhis2.org:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Hello Bjorn,
Thank you for these responses.

I have this kind of problem about calling my custom map in my app, I wonder if it’s about version or what.

I tried dhis2 2.25 and 2.22 but the same errors.

Please find attached some files.

Regards.

Diao

image

image

image

···

On Wed, May 17, 2017 at 9:22 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

Hi Diao,

Do you have the chance to upgrade to DHIS 2.26? Then you can include these files:

Regards,

image

image

image

···

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Tue, May 23, 2017 at 10:40 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hello Bjorn,
Thank you for these responses.

I have this kind of problem about calling my custom map in my app, I wonder if it’s about version or what.

I tried dhis2 2.25 and 2.22 but the same errors.

Please find attached some files.

Regards.

Diao

On Wed, May 17, 2017 at 9:22 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

Hi Bjorn,

Thank you for your help.

As you recommended, I upgraded to 2.26 and I can show a simple map.

But when I try to show a costum map with facilities I get an error about dimension of facilities, please can you help about it.

Thank you my dear.

Diao

image

image

image

···

On Wed, May 24, 2017 at 9:27 AM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Diao,

Do you have the chance to upgrade to DHIS 2.26? Then you can include these files:

Regards,


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Tue, May 23, 2017 at 10:40 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hello Bjorn,
Thank you for these responses.

I have this kind of problem about calling my custom map in my app, I wonder if it’s about version or what.

I tried dhis2 2.25 and 2.22 but the same errors.

Please find attached some files.

Regards.

Diao


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Wed, May 17, 2017 at 9:22 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

Hi Diao,

So the maps load in the GIS App, but not as a plugin?

Could you email me code you use to create the map?

Cheers,

image

image

image

···

On Wed, May 31, 2017 at 12:46 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hi Bjorn,

Thank you for your help.

As you recommended, I upgraded to 2.26 and I can show a simple map.

But when I try to show a costum map with facilities I get an error about dimension of facilities, please can you help about it.

Thank you my dear.

Diao

On Wed, May 24, 2017 at 9:27 AM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Diao,

Do you have the chance to upgrade to DHIS 2.26? Then you can include these files:

Regards,


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org


**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Tue, May 23, 2017 at 10:40 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hello Bjorn,
Thank you for these responses.

I have this kind of problem about calling my custom map in my app, I wonder if it’s about version or what.

I tried dhis2 2.25 and 2.22 but the same errors.

Please find attached some files.

Regards.

Diao


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Wed, May 17, 2017 at 9:22 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

Yes the map load in the GIS App, but when I call it in another App that i’m developping I have this error.
When I set up a simple map whithout facilities it works good, so the problem is showing the facilities but I don’t see any solution.

Please find attached the custom map that I’m trying to show and the codes.

Thank you again.

Diao

image

image

image

···

On Wed, May 31, 2017 at 4:00 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Diao,

So the maps load in the GIS App, but not as a plugin?

Could you email me code you use to create the map?

Cheers,

Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Wed, May 31, 2017 at 12:46 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hi Bjorn,

Thank you for your help.

As you recommended, I upgraded to 2.26 and I can show a simple map.

But when I try to show a costum map with facilities I get an error about dimension of facilities, please can you help about it.

Thank you my dear.

Diao


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Wed, May 24, 2017 at 9:27 AM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Diao,

Do you have the chance to upgrade to DHIS 2.26? Then you can include these files:

Regards,


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org


**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Tue, May 23, 2017 at 10:40 PM, Mamadou Diao Diallo diao_diallo@gn.jsi.com wrote:

Hello Bjorn,
Thank you for these responses.

I have this kind of problem about calling my custom map in my app, I wonder if it’s about version or what.

I tried dhis2 2.25 and 2.22 but the same errors.

Please find attached some files.

Regards.

Diao


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Wed, May 17, 2017 at 9:22 PM, Bjørn Sandvik bjorn@dhis2.org wrote:

Hi Ramón,

I presume the your DHIS 2 instance is running v2.26? You can’t use the 2.26 map plugin towards a 2.22 version of the Web API.

You should make the map div bigger by setting a height value in CSS.

If you want Google Maps as a basemap, use

basemap: “googleStreets”

Bjørn


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

On Mon, May 15, 2017 at 5:41 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hi again,

I think that’s better. There’s no errors, ok, but there’s lot of code inside the div and a blank narrow element in the page.

Thank you again for your help !

PS: The user/pass seem to be not relevant.

PS2: That’s how I do the imports


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

On Mon, May 15, 2017 at 2:44 PM, Ramón José Jiménez Pomareta dhis2@pomareta.ch wrote:

Hello !

I am able to show a map when doing a custom map but there’s a permanent message saying “loading” and no data. I dot that with that code. Hay anyone been successful using maps ?

Thanks !

Here the code :

Ext.onReady( function (){

DHIS.getMap({

url: base,

el: “map1”,

mapViews: [{

columns: [{dimension: “de”, items: [{id: “ABCD…”}]}], // data

rows: [{dimension: “ou”, items: [{id: “LEVEL-3”}, {id: “ABCDE…”}]}], // organisation units,

filters: [{dimension: “pe”, items: [{id: “201510”}]}], // period

// All following options are optional

classes: 7,

colorLow: “02079c”,

colorHigh: “e5ecff”,

opacity: 0.9

}],

baseLayer :“gs”

});

});


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Bjørn Sandvik

GIS developer, DHIS 2

University of Oslo

www.dhis2.org

2017-05-08 15:10 GMT+02:00 Ramón José Jiménez Pomareta dhis2@pomareta.ch:

Hello,

I am trying to put a custom map in a web page. I experimented some issued and I decided to start doing the most basic case: an existing map. There’s no errors on the webpage but the map doesn’t appear on the div.

Do you have any clue ? The samples on the web don’t work neither.

Thanks a lot !

Ramón.

PS: Here’s some code :

The html div

Impor****ts :

$( document ).ready( function() {

$(‘head’).append(‘’);

What I see on Google Chrome :

**DIALLO Mamadou Diao Conseiller IT, Specialiste de DHIS 2 **( District Health Information Software )

Projet de Renforcement du Système d’Information Sanitaire en Guinée

Phone : 623909413 | 662256106

Skype : diawwdiallo

www.jsi.com

Can you please share your links because in my case I am not able to use DHIS.getMap(), they are always telling that DHIS is not define

HI @software_developer20,
Would you please explain the issue further with a bit more details and maybe a screenshot. The topic you are responding to is 4 years old so things eventually get updated. Thank you!

Hello @Gassim. Thanks in advance
I am trying to embed dhsh2 map in my javascript application but as you are aware the links in the documentation are no longer working, so I downloaded the chartPlugin and the mapPlugin contents and it worked perfectly when I pull a chart but anytime I try to pull a map i get an error which tells DHIS is not defined, I think this might be a problem relative to my links. I am going attached the screenshot of the code, the links and the error I am getting.



maperror
I hope this will help and thanks once again

Hey! You’re welcome, and thank you! One quick question please, have you seen the Developer’s portal documentation and guides? I hope it’ll help: How to add a Table component | DHIS2 Developer Portal