Tag Info

Hot answers tagged

7

Can do this without any plugin, you need only the Google Maps API. Please note that if you plan to have 20 markers or more on a single page, you have to geolocate posts using coordinates and not addresses. To save coordinates from an address you can: manually use a service (something like this) call Google maps geocoding from WP admin when you create or ...


4

You should avoid creating more tables. Just do it if you really have a good reason to. Note that wp_postmeta can store practically any kind of data, and simply using the get_post_meta function can do all the job in most cases. But if you must use another table, and taking it generally, then you're looking for the save_post and delete_post hooks. ...


4

Wierd, just re-read your comment and looks like your shortcode is working when you call it that early - if the map-canvas div is showing up. here's the code I tested, also added jquery as a dependency for your custom script & changed some css on you div... function lax_google_map_init() { wp_enqueue_script('google-maps', ...


3

I think GeoMashup is the go-to plugin for something like this. http://wordpress.org/extend/plugins/geo-mashup/ I've used it for a similar site with great results. There's a lot to dig into, it's very flexible, but you'll definitely be able to get what you want.


3

Mappress allows for custom markers, but you need to pay for the pro version. http://wordpress.org/extend/plugins/mappress-google-maps-for-wordpress/ Google Map Shortcode also supports custom markers in a shortcode http://wordpress.org/extend/plugins/google-map-shortcode/ Getting custom overlays on Google maps is actually pretty easy, you can read the docs ...


3

This is a simple mathimatical problem. You will indeed need access to both your longitude and latitude, so save it in a metafield. than you will have to query your posts like this as a sql query. Haven't got a chance to test it. and or pour it into wordpress. Don't have access to my test env now. But I guess you could do it yourself :) if not I'll do it ...


3

Well, this is kind of easy.. The google-map API needs a format like Your Street 123, 54321 Your City Assuming you have your data like this: <div id="street">Your Street 123</div> <div id="zip">54321</div> <div id="city">Your City</div> Assuming you are using jQuery: (function($){ $.fn.create_gmap_address = ...


3

Lots of ways to proceed here. Here's one way to do it: Find a JavaScript/jQuery plugin that works with map markers. I used Mosne Map, it's old but it works. Generate the HTML markup that the above plugin will use. I needed a more user-friendly way to add markers, so I utilized ACF's Repeater Field type for this because I had one page with a map, so it was ...


2

You could use this plugin, although it may only be compatible to 3.2.1. And this plugin may help you out, although it seems a little complicated to implement a map for all the posts. You could also use a custom field for lat/long on each post, and then create markers using wpdb calls, grabbing the post_meta data, and using the Google Maps API to place the ...


2

To connect your meta fields with the "Geo Data Store"-Plugin, you simply take the name of the meta key/field and map it with the filter to the plugin. add_filter( 'sc_geodatastore_meta_keys', 'wpse82502_lat_lng_metakey_mapping' ); function wpse82502_lat_lng_metakey_mapping( $keys ) { $keys[] = "your_meta_key_field_name"; return $keys; } To get the ...


2

You are using iframe in tab structure.So, 1) When page loads fully, the iframe in itenary tab has display none. so it is not loading the zoomed map properly. 2) When you switch to itenary tab before loading completes, iframe is display block i.e visible so it loads the url/map properly. So for this what you can do is give id to your iframe say ...


2

These errors come from CSS rules from your WordPress theme that are also applied to elements on the map. For example, on your page, I was able to fix the popup by disabling the #content table and #content tr th rules which add extra margins. In a test setup I even got gray gaps between the tiles because of .entry-content img { max-width: 97.5% } in Twenty ...


2

Nm, figured it out: <?php echo GeoMashup::map( 'map_content=global&map_cat=1,2,3,4,5' . $cat->term_id ); ?>


2

I've done something similar using gmaps (http://gmap.nurtext.de/). You might want to take a look at that. It's self explanatory and there's quite a bit of documentation IF you google around.


2

Dean, your best bet is to do it through JS on the front end. I use the following function to covert the postcode to a Lat and Lng: function codeAddress(address){ geocoder.geocode({ 'address': address }, function(results, status){ if(status == google.maps.GeocoderStatus.OK){ map.setCenter(results[0].geometry.location); ...


1

By default, PHP is stripped out of the posts content. You can use this plugin to aleivate this: http://wordpress.org/extend/plugins/exec-php/ This will give you a quick, easy fix to be able to do it the way you are trying to. I would suggest reading http://codex.wordpress.org/Custom_Fields for the more proper way to do this though.


1

There are a lot of pieces to this puzzle. You need to be able to convert the postcodes into a numerical data format so you can query the pages/posts with "is greater than [current location minus 5 miles] and less than [current location plus 5 miles". In two dimensions. This means storing the latitude and longitude with the page. You can automate this, so ...


1

Mapsmarker looks pretty robust. On their feature list page they state that you can organize your markers in layers, so maybe that work for categories. I have not used it. I have used Mappress which allows you to add custom markers and you can create different maps on different pages if you want to categorize them like that.


1

For create the links to your child sites use this function elenco_sotto_siti(){ global $wpdb; $blogs = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE public='1' AND archived='0' AND mature='0' AND spam='0' AND deleted='0' ORDER BY blog_id "),ARRAY_A ); return $blogs; } For question 2 and 3, i use the option ...


1

The only way to get multiple markers on a map is to use the Google Maps API. https://developers.google.com/maps/documentation/javascript/tutorial. The way you are referencing through an iframe only allows one marker(one location).


1

After some more Googling... New single.php looks like this: <?php get_header(); global $wp_query; if ( ! isset( $wp_query->query_vars['map'] ) ) { if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_content(); endwhile; endif; ?> <p><a ...


1

if u think that is the problem simply do: $csf_map_output .= '<script> jQuery(document).ready(function(){ var csf_map_params = ' . json_encode( $atts ) . '; csf_map_maker_js( csf_map_params ); }); </script>'; I don't see any scope issues with the above code.


1

Take a look at this I did for a client: http://lpoc.co.uk/properties-for-sale/ A user can click the map and choose where to search. When a user clicks it updates a couple of hidden fields. Feel free to look at the source code to see how its done. If you want a more in depth description of the google maps api and javascript then this question would be ...


1

Unfortunately there is no easy fix for this, I tried this myself a while ago, and ended up not using any tabs for map rendering since it was the only reliable option. I had some success with messing about with CSS but all browsers (and mobile) reacted differently. The reason is Google maps computes it's values on page load, there are some hacky solutions ...


1

From quick test snippet you provided does embed map seemingly correctly. There is nothing on that map, because marker points to the middle of nowhere, you can see some road if you drag around. Are you inserting this in body of page? In HTML mode? It is good practice to make use of wp_enqueue_script(), when dealing with scripts in WordPress. However your ...


1

@Richard, it's hard to answer this in detail with this little details. Do you need to pinpoint a single house? Will you use an address or will you use latitude and longitude? My suggestion would be to take a look at this excellent Google Maps Plugin for jQuery. jQuery is part of any WordPress installation, so you wouldn't need to install anything else. ...


1

I've used it like this and it works well ;-) $(".div").html("<iframe width='850' height='450' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://yourlocation.com'></iframe>"); $(".div").css("display","block");


1

I have managed to find the problem. Basically calling the google API from the footer was causing the maps to break and not function properly.


1

The default search is handled by WP_Query mostly by a method called parse_search(), which is triggered by the s parameter. You can search the source of WP_Query for is_search and piece together a few other bits and pieces. Or you can just create a query... $s = new WP_Query(array('s' => 'test')); ... dump the SQL... var_dump($s->request); ... ...



Only top voted, non community-wiki answers of a minimum length are eligible