Smart M.App discussions

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Posts: 34
Registered: ‎10-21-2016
Accepted Solution

Bounding box data not accepted by zoom-function

Hello everybody,


I have a working Smart M.App, made out of a recipe panel and a BI Map panel. A choropleth is drawn near Rotterdam, Netherlands, and it works, as well as the charts. 

Out of the GeoJSON which is used, I can extract the bounding box information. I checked and made sure they are the correct coordinates. I have been trying to implement a zoom function using these coordinates:{"bbox": [4.538801, 51.915823, 4.552856, 51.918814], "animationTime": 1}, 
function zoomSuccess(){
}, onError


The problem is: every time it zooms to the same location [0, 0, 0, 0]. I've tried many configurations, but it seems like the boundingbox-data is removed from the function, in some way. Maybe the function expects the arguments in a different format.


Does anyone have experience with this? I read a topic which is quite similar to this one, but I can't find a solution over there either. I was wondering if there is currently anyone who knows the reason or has a solution for this.




Technical Evangelist
Posts: 1,351
Registered: ‎09-11-2015

Re: Bounding box data not accepted by zoom-function

Hi Vincent,


your coordinates look to be in WGS84 (EPSG:4326) but the maps actually use EPSG:3857 (by default). Please have a look at this sample code available in M.App Studio, you might need to do the coordinates translation:


// transform sample points to current CRS{
    points: [bottomLeftCorner, topRightCorner],
    sourceCrsId: "EPSG:4326",
}, function (transformationResult) {
    // get BBOX in form minx, miny, maxx, maxy
    var points = transformationResult.points,
        bbox = [points[0].x, points[0].y, points[1].x, points[1].y];{
        bbox: bbox
    }, function () {
        // display information{           



Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Posts: 34
Registered: ‎10-21-2016

Re: Bounding box data not accepted by zoom-function

Thanks a lot Jan, it works!