* msTileGetGMapCoords * ************************************************************************/
| 50 | * msTileGetGMapCoords * |
| 51 | ************************************************************************/ |
| 52 | static 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 | /************************************************************************ |
no test coverage detected