I’m a senior PHP developer but have rarely used WordPress.
My question is how difficult is it to incorporate custom PHP code into WordPress?
Not only PHP, but JS Ajax calls to PHP as well?
My plan is to build a site using WordPress but there will be some custom searching (e.g. Google map api calls, etc )
How difficult is this with WordPress?
It’s easy, WordPress is a PHP project like any other. Just dated, coming from old style procedural PHP days. There had been plenty of third party effort to iron out how to run it with more relevant PHP development practices (such as Composer) though.
You are completely in control of theme code and can use anything you want on front-end side. For integrating well with WP it would be advisable to get acquainted with how it does related things, queueing assets and such, for best compatibility.
If you mean making JS calls to WP itself: there is older rather barebone AJAX endpoint where you just add a callback with arbitrary logic, and newer WP REST API that is more framework-y and can be extended.
It’s quite easy to add your own code, just create your own plugin that contains … whatever you need. Create a blank PHP file, add the [necessary headers](https://developer.wordpress.org/plugins/plugin-basics/header-requirements/) and you’re good to start adding hooks onto filters, actions, etc.