No need for Javascript. You can check tile ID using "Tilemap Compare tile at" condition. Say, if it's a ground tile - spawn an earth creature. If it's a water tile - spawn water creature.
To convert between layout and tilemap coordinates use these expressions:
construct.net/en/make-games/manuals/construct-3/plugin-reference/tilemap