MCPcopy Create free account
hub / github.com/MapServer/MapServer / msTileGetGMapCoords

Function msTileGetGMapCoords

maptile.c:52–77  ·  view source on GitHub ↗

* msTileGetGMapCoords * ************************************************************************/

Source from the content-addressed store, hash-verified

50 * msTileGetGMapCoords *
51 ************************************************************************/
52static int msTileGetGMapCoords(const char *coordstring, int *x, int *y, int *zoom) {
53
54 int num_coords = 0;
55 char **coords = NULL;
56
57 if( coordstring ) {
58 coords = msStringSplit(coordstring, ' ', &(num_coords));
59 if( num_coords != 3 ) {
60 msSetError(MS_WEBERR, "Invalid number of tile coordinates (should be three).", "msTileSetup()");
61 return MS_FAILURE;
62 }
63 }
64 else {
65 msSetError(MS_WEBERR, "Tile parameter not set.", "msTileSetup()");
66 return MS_FAILURE;
67 }
68
69 if( x )
70 *x = strtol(coords[0], NULL, 10);
71 if( y )
72 *y = strtol(coords[1], NULL, 10);
73 if( zoom )
74 *zoom = strtol(coords[2], NULL, 10);
75
76 return MS_SUCCESS;
77}
78
79
80/************************************************************************

Callers 3

msTileExtractSubTileFunction · 0.85
msTileSetupFunction · 0.85
msTileSetExtentFunction · 0.85

Calls 2

msStringSplitFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected