Viewing 3 replies - 1 through 3 (of 3 total)
  • @robertaguilerajr,

    The info window can definitely be changed. Take a look at the last question/answer on the FAQ page to learn more.

    However, I’m not clear what you mean by wanting a link that opens up the “users map application”.

    Thread Starter Robertaguilerajr

    (@robertaguilerajr)

    Micah,

    Thanks for the response. What I mean is If a user clicks on the drop-pin, and then clicks on the title, it redirects them to either a browser window that loads google maps with the directions in place, or if on a mobile device, it opens up their map application.

    For example, the code for a webpage would look like this:

    href=”https://www.google.com/maps/place/Venice,+FL/@27.114846,-82.4146291,13z/data=!3m1!4b1!4m2!3m1!1s0x88c34e48300b2dfb:0x52ac882236d6b362″ target=”_blank”>555 N. Redondo Beach, CA

    If the user clicks on the link it’ll redirect them automatically to the address. I guess I’m looking for the bit of code that will automatically pull the address, put it into an anchor tag, displays it, then when clicked on it opens up a google maps window or the users default map app on the users phone.

    @robertaguilerajr

    Here is some code that will add a googleMapsUrl property to the place objects:

    add_filter( 'stellar_place', 'stellar_place_add_custom_properties' );
    function stellar_place_add_custom_properties( Stellar_Places_Place_Model $place ) {
    	$address_parts        = array_filter( array(
    		$place->streetAddress,
    		$place->addressLocality,
    		$place->addressRegion,
    		$place->postalCode,
    		$place->addressCountry
    	) );
    	$location             = str_replace( ' ', '+', join( ',+', array_map('urlencode', $address_parts ) ) );
    	$place->googleMapsUrl = "https://www.google.com/maps/place/{$location}";
    	return $place;
    }

    Then, in your info-window.html template that you copy into the theme you can just change url to reference googleMapsUrl.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Ability to Link to Map App’ is closed to new replies.